Hi Bharathi, Probably because you are doing something like this on the input stream: 1\n2\n3\n4\n5\n (Where '\n' represents a newline, 0x0A, decimal value 10.) Change your scanf to this: scanf("%c\n", &c); Sincerely, --Eljay