input:--
3
hi hello
my name is abc
this is a test
output:--
hi hello
my name is abc
this is a test
here is the code:--
#include<stdio.h>
main()
{
int n,i;
char b[100],*c;
scanf("%d",&n);
for(i=0;i<n;i++)
{
gets(b);
c=b;
while(*c !='\0')
{
putchar(*c);
c++;
}
printf("\n");
}
return 0;
}
My code is not getting right answer for n=1.
In the code I cant use scanf() coz i have to take space also as an input.
and if I am using gets() the for loop first for loop for n continues without taking any input and print next line, I am not understanding why this is happening and how to correct..please guide me..