Friday 10 November 2017

C Program to Find the Number of Elements in an Array


Code:

#include
#include
#include

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;
}

Output:

Size of the given array is 7


More C Programs:












100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...