Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 9 > lesson 8 in c

#include <stdio.h>

int main() {

char cities[4][10];
int i;
for(i=0;i<3;i++) {
fgets(cities[i],10,stdin);
}

printf("%s", cities[2]);

return 0;
}

This code is working , but it cannot be submitted because:-

"fgets should be used inside the loop" (As per Message)

while fgets is already inside the loop.
by

1 Answer

Login / Signup to Answer the Question.