main()

{

printf("\nab");

printf("\bsi");

printf("\rha");

}

Answers were Sorted based on User's Feedback



main() { printf("\nab"); printf("\bsi"); printf..

Answer / susie

Answer :

hai

Explanation:

\n - newline

\b - backspace

\r - linefeed

Is This Answer Correct ?    93 Yes 13 No

main() { printf("\nab"); printf("\bsi"); printf..

Answer / jane

<new line>ab<backspace>si<carriage return>ha

First, handle the backspace. Note that even though it is "non-erase", the next character to be output would overwrite what was backspaced over:

<new line>asi<carriage return>ha

Now, a carriage return means to go back to the beginning of the line. So the "ha" overwrites the "as" in "asi:

<new line>hai

Now, the cursor is currently sitting on the i, so the next character to be output would overwrite i.

Is This Answer Correct ?    34 Yes 2 No

main() { printf("\nab"); printf("\bsi"); printf..

Answer / dhiraj s

Ans-hai

Is This Answer Correct ?    32 Yes 2 No

Post New Answer

More C Code Interview Questions

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


plz send me all data structure related programs

2 Answers  


String copy logic in one line.

11 Answers   Microsoft, NetApp,


main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }

1 Answers  


#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }

1 Answers   TCS,


How can i find first 5 natural Numbers without using any loop in c language????????

2 Answers   Microsoft,


Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list)

3 Answers   Disney, Google, ZS Associates,


What is the main difference between STRUCTURE and UNION?

13 Answers   HCL,


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

0 Answers  


How we print the table of 2 using for loop in c programing?

14 Answers   HCL, Wipro,


#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }

1 Answers  


Categories