// first write this program and run it
void main()
{
int a;
printf(“Enter the integer – ”);
scanf(“%d”,&a);
printf(“%d”,a);
getch();
}
// Now write and run this program
void main()
{
int a;
printf(“Enter the integer – ”);
scanf(“%d”,&a);
printf(“%d”,a);
getch();
}
// This will clear your doubts regarding this
It can be used to go to the next line, the console moves to the next line that’s the ultimate use of it.
Best part is with the help of “\n” the output or text in the console can be easily distinguished, you can use “\t” to create space between text also.
Thanks!