test cases

while(t–)
{
while((ch=getchar())!=’\n’)
{
code;
}
}
if i give 4 test cases ,then it runs for only 3 and terminates…can anybody rectify the code??

It should run 4 times…