Good day everyone. I am a newbie in C, just started out like 4 days ago. I am currently doing 2 dimensional arrays and came across this example. But when i ran it in the compiler, it says the for loop is only allowed in C99 mode. and im notsure if there are other errors. Help would be appreciated .Tq.
Code:
#include <stdio.h>
int main()
{
int temperature[CITY][WEEK];
for(int i =0; i < CITY;++i){
for(int j =0; j < WEEK;++j){
printf("City %d, Day %d: ", i+1, j+1);
scanf("%d",&temperature[i][j]);
}
}
printf("\nDisplaying values: \n\n");
for(int i =0; i < CITY;++i){
for(int j =0; j < WEEK;++j)
{
printf("City %d, Day %d = %d\n", i+1, j+1, temperature[i][j]);
}
}
return0;
}