#include <stdio.h>
int main()
{
int num[] = {2,8,7,6,0};
int i;
for(i=0;i<5;i++) {
printf("\nArray Element of num[%d] : %d",i+1,num[i]);
}
return 0;
}
///different way
int main()
{
int arr[3],i;
printf(“Enter 3 values:”);
for(i=0;i<3;i++)
{
scanf("%d",&arr[i])
}
printf(“\nThe entered values are:”);
for(i=0;i<3;i++)
{
printf("%d ",arr[i]);
}
return 0;
}
No comments:
Post a Comment