1.After using the "scanf" function a newline is automatically printed.Please tell me how can I stop printing a new line after using "scanf" function.

2.After printing anything in a line, how to erase it?

3.How to go back to the previous line after printing a new line?

plzzzz, help...I am a beginner...but want to know these things....

asked 10 Jan '16, 16:35

Onall's gravatar image


edited 10 Jan '16, 17:05

  1. Actually No New Line is printed automatically after taking input from console, rather this new line is entered by you!
  2. If the shell is interactive, then it is not possible with C/C++ in most of the cases as far I know. But if your shell is not interactive, then you may do this by using the \b (backspace). Here, the word interactive, I meant taking input from user. But remember, it is also possible when running from terminal or cmd with the help of other tools. See here if you are curious about it.
  3. Actually answer of 2 answers this if you want to go there by deleting. Otherwise it is not possible in console as far I know.

And I am very curious to know, why you need this! May be there are some reasons, but they may handle by other means.


permanent link

answered 15 Apr '16, 08:04

manetsus's gravatar image


  1. scanf (" %c",&ch);

2 এবং 3 console সম্ভব না ।

permanent link

answered 15 Apr '16, 06:50

ih_hira's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 10 Jan '16, 16:35

question was seen: 1,638 times

last updated: 15 Apr '16, 08:04