Arrays
Arrays
in
‘C’
Needs …
printf(“%d”, numbers[2]);
Create an array of 10 integers, store 10
numbers to them. Then display them.
void main()
{ /* Create and Reading part */
int no[10], index;
printf(“Enter 10 numbers\n”);
for( index = 0; index < 10; index ++ )
{
printf (“Number-%d”, index + 1);
scanf(“%d”, & no[ index ]);
}
Pgm contd…
a b c d \0 x y z \0 m n \0
Unused slots
Unsized double dimensional array