0

Can someone explain the below output.

I can't figure out why the output of the following statements:

printf("\n Hello"); printf("\b world"); printf("\r Cup"); 

is:

 Cupl world 

1 Answer 1

3

Lets use | as carriage:

After "\n": |

After " Hello": Hello|

After "\b": Hell|

After " world": Hell world|

After "\r": | Hell world

After " Cup": Cup|l world

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.