In the Lecture 2 Short on Arrays, Doug Lloyd suggests that it would be a good practice problem to try to output each element of a 100-element array as an integer corresponding to its index position.
Any thoughts as to if I'm on the right track here and what to change? As it is, I keep getting 100 zeros as my output ha.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int array[100];
// ?? HOW do I get it to output each int in the array to match its index position, using a loop?
for (int i = 0; i < 100; i++)
{
int x = array[i];
// Why does this not work??
printf("%i\n", x);
}
}