xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
int arr[] = {10,20,30,40,50,60};
int arrSize = sizeof(arr)/sizeof(arr[0]);
cout << "The size of the array is: " << arrSize;
return 0;
{
xxxxxxxxxx
There are two methods for finding the size of an array.
int n = sizeof(arr)/sizeof(arr[0]);
int n = (int)arr.size();