100% to find no. of elements in the array
//program to know how many numbers are there in the array
#include <stdio.h>
void main( )
{
int n,p=50,no_of_bytes,packets[ ]={9,-1,7,4,5,11,8,4};
no_of_bytes=sizeof(packets);
n= no_of_bytes/sizeof(p);
void main( )
{
int n,p=50,no_of_bytes,packets[ ]={9,-1,7,4,5,11,8,4};
no_of_bytes=sizeof(packets);
n= no_of_bytes/sizeof(p);
printf("\n the memory occupied by the array=%d",no_of_bytes);
printf("\n number of elements in array=:%d",n);
}
printf("\n number of elements in array=:%d",n);
}
ఔట్పుట్ తెరమీద
the memory occupied by the array=32
number of elements in array=:8
number of elements in array=:8
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.