C program for size of array


#include <stdio.h>
int main( )
{
 int i,num;
 printf("\nEnter the hoe many elements you want?\n");
 scanf("%d",&num);
 int a[num];
 printf("\nEnter the %d elements:\n",num);
 for(i=0;i<num;i++)
 {
  scanf("%d",&a[i]);
 }
 printf("Elements in array are:\n");
 for(i=0;i<num;i++)
 {
  printf("%d\n",a[i]);
 }
 printf(" The size of the array is: %d Bytes.",(int )sizeof(a));
 return 0 ;
}


Output:

C programs, c programming, array


06 Aug 2015

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top