#include<stdio.h>
int main()
{
int marks[5]; //declare without initialization
for (int i = 0; i <5; i++)
{
printf("Enter the %d of the valve of array\n",i);
scanf("%d",&marks[i]);
}
for (int i = 0; i < 5; i++)
{
printf("The value of %d value of the array is %d\n",i,marks[i]);
}
return 0;
}
//Or we can also do like this
#include<stdio.h>
int main()
{
int marks[5]={95,97,91,93,99}; // declare with initialization
for (int i = 0; i < 5; i++)
{
printf("The value of %d value of the array is %d\n",i,marks[i]);
}
return 0;
}
Comments
Post a Comment