Problem Description
Store and retrieve elements from an arrayCODING ARENA
#include <stdio.h>
int main()
{
int a[100],i,n;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
printf("element %d=%d\n",i,a[i]);
}
return 0;
}
Test Case 1
Input (stdin)5 10 20 30 50 40
Expected Outputelement 0=10 element 1=20 element 2=30 element 3=50 element 4=40
Test Case 2
Input (stdin)4 10 20 30 40
Expected Outputelement 0=10 element 1=20 element 2=30 element 3=40
No comments:
Post a Comment