who can tell me what the use of "\n" is? and what the difference between





In C, the '\n' character is a special type of character called a control character, these are characters that do something other then just display themselves, here is all the ones that I know:

\n = newline
\t = tab
\a = This one rocks, it makes the computer make a beeping sound :D

The difference between those follows:

Say you called the first one, then the user entered 'hello', j would now be 'hello', if you called the second one, j would be 'hello\n' and whenever you printed out j after the second one, it would print out hello followed by a newline

if i use this in a program its keep on taking the return key
the program not getting terminated, whats the problem?


It discards unwanted white space.
A white-space character in the control string causes scanf() to skip over one or more leading white-space characters in the input stream.

int main()
 char ch,ch1;

 printf("Enter two chars : ");
 return 0;