+ 1
Not executing properly.Please help
#include<stdio.h> int main()//program to accept input and print on screen. { int a[5],i; printf("Enter numbers to store in array\n"); for(i=0;i<5;i++) { printf("Enter the input for index %d",i); scanf("%d",&a[i]); } for(i=0; i<5 ;i++) { printf("%d",a[i]); } return 0; }
2 Answers
+ 2
Strange. I've checked with a desktop compiler, and it works fine (save the formatitng and spacing issues, which can be trivially solved).
+ 1
#include<stdio.h>
int main()
{
int a[5],i;
printf("Enter numbers to store in array\n");
for(i=0;i<5;i++)
{
printf("Enter the input for index %d :",i);
scanf("%d",&a[i]);
printf("%d\n",a[i]);
}
return 0;
}