Simple C Program for Find Array Size


Definition

An array is a collection of data that holds homogeneous values. That means values should be in same type

Array Syntax

type variable_name[size]

Sizeof Syntax

sizeof(data_type)

Simple C Program for Find Array Size

/*## Simple C Program for Find Array Size */
/*## Simple Array Programs,Find Array Size C Programming, sizeof Example*/


#include <stdio.h>
 
int main() {

	// Declare Array Variable
    int array[5]= { 1, 2, 3, 4, 5 };
    
    //Read Day Value
	int size;
	
	size = sizeof(array)/sizeof(int);

    //Print size of Array
    printf("The Size of Array is %d", size);
    
   
	return 0;
}

Sample Output:

The Size of Array is 5