I am trying to understand carriage return(\r). So I have written the code below. If i run the below code, I am getting the output is "go".
Method1:
#include <stdio.h>
int main()
{
printf("chi\rca\rgo");
return 0;
}
But if i have tried with "\n", then i am getting the output "goi".
Method 2:
#include <stdio.h>
int main()
{
printf("chi\rca\rgo\n");
return 0;
}
What is the error in this?
Can anyone help me ?