Whenever the code is executed, the contents inside the for loop are not executing for the first time, i.e., when i=0. But the loop executes after i=0, i.e., for i=1,2,3,..n-1. Can anyone explain what's wrong here?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
char string[30][100];
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++){
gets(string[i]);
printf("%s\n",string[i]);
}
getch();
return (EXIT_SUCCESS);
}