0
Got strucked at array intialization!
I had done a simple code to get value from array but i struck at scanf line please leave your solution https://code.sololearn.com/cJYlBRkNPph3/?ref=app
2 Answers
0
You just missed a & in your scanf.
The following works:
#include<stdio.h>
int main()
{
int array[10];
int i;
for(i=0;i<10;i++){
scanf("%d",&array[i]);// ampersand required to get memory address to store into.
}
for(i=0;i<10;i++){
printf("%d",array[i]);// no ampersand needed because the value to print is sufficient. We don't need to know where the value came from.
}
}
0
Thank you so much