C Programming language

adplus-dvertising
C Program example: Program to get the Array length
Previous Home Next
Program for printing the length of an Array
/** Program for printing the length of an Array **/

#include <stdio.h>
#include <conio.h>
int a[6]= { 10, 29, 36, 44, 53, 62 };
void main() 
{
	clrscr();
	int l=sizeof(int)/sizeof(a);
	printf ("Length Of Array is=%d", l);
	getch();
}
Output: 6
Previous Home Next