Hi,
I'm having a problem with entering numbers into an array and then printing them out again. I'm pretty new to programming which is probably what the problem is...
So far, I have the following:
Code:
#include<stdio.h>
int main(){
int array[10];
int i;
for (i = 0;i <= 10;i++)
{
printf("\nEnter a number:");
scanf("%d", array[i]);
}
for (i = 0;i <= 10;i++)
{
printf("\nArray %d: %d", i, array[i]);
}
}
When I compile and run the program, it asks me to enter a number. I enter the number and then it says 'Segmentation fault' and closes.
Could anyone please advise on where I'm going wrong with this?
Many thanks