Discussion Forums

New User? Please read instructions!

C program to find array size  

  RSS

thiyagarajan
Eminent Member
Joined: 5 months  ago
Posts: 26
27/01/2017 9:46 am  

How to find array size and write a C program for the same.


ReplyQuote
admin
Eminent Member
Joined: 5 years  ago
Posts: 26
10/02/2017 7:14 am  

C program to find array size:

 

#include <stdio.h>

int arr[8]= { 1, 2, 3, 4, 5, 6, 7, 8 };

 

int main() 

{

  int length;

  length = sizeof(arr)/sizeof(int);

  printf("The length of Array is %d", length);

  return 0;

}

 

Output:

The length of Array is 8


ReplyQuote
  
Working

Please Login or Register

Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin

Close
We Support JALLIKATTU !!!
We Support JALLIKATTU!
By Fresh2Refresh.com
Show Your Support as well. Thanks!