A: 

maybe-

cprintf("\b#");

'b' is for backspace

shoosh
+1  A: 

-1: Some tips for posting homework questions:

1) Get the question right! The posted code does not perform as the description states:

 for(i=0;i<10;i++)
    prinf("#");

This will print 10 # characters on one line, as there is no end-of-line character. The original description talks about "printing 10 lines."

2) Give necessary details: What environment are you using: Windows? Linux? What compiler? Is this a windowed or text-based environment?

3) STFW before posting. Look for "ANSI Escape Sequences" or "positioning the cursor."

Adam Liss
+3  A: 

It looks like you are mixing printf and another output library - this isn't recommended. Printf expects to be sent to a character terminal, while the output library in question may falsly assume that it has exclusive access (and might misbehave.)

Based on one function, you're likely using conio.h. The documentation can be found here, with a table of contents showing each available function. From that index, you should be able to spot the function instantly.

The window function doesn't do what you want it to, since it only sets the area in which the cursor may change text - it doesn't move the cursor, you need to use the other library functions.

Raymond Martineau
+1  A: 
A: 

With window and gotoxy i have solved the above problem thank u.

Manoj Doubts