Statement C Program: This Program illustrates the Initialization of Five integers to the corresponding elements of a 1-D Array.
#include<stdio.h>
#include<conio.h>
void main()
{
int marks [ ] = {20 , 40 , 60 , 80 , 55 , 95};
int i;
for(i=0 ; i<5 ; i++)
{
printf("marks[%d] = %d\n " , marks[i] , i);
} /* End of main() */
Output:
Elements are
marks[0] = 20
marks[1] = 40
marks[2] = 60
marks[3] = 80
marks[4] = 55
marks[5] = 95
That's All
0 Response to "Write a Program (WAP) of Initialization of an Array Elements"
Post a Comment