Count array elements without using sizeof() operator.

C program to count array elements without using sizeof() operator.

Program

#include<stdio.h>
#include<conio.h>
#define MAX 50

void main()
{
	int arr[] = {1,2,3,4,5,6,7,8,9};
    int size;

    size = *(&arr + 1) - arr;

    printf("Size of the array is\t:%d",size);
    getch();
}

Output

Size of the array is    :9