programming-examples/c/Arrays/C Program to Find the Number of Elements in an Array.c

19 lines
348 B
C
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C Program to Find the Number of Elements in an Array
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
int array[] = {15, 50, 34, 20, 10, 79, 100};
int n;
n = sizeof(array);
printf("Size of the given array is %d\n", n/sizeof(int));
return 0;
}
/*
Size of the given array is 7