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 ?    92 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

Find the largest number in a binary tree

7 Answers   Infosys,


main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000

3 Answers   HCL,


void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

2 Answers  


void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }

1 Answers  


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

2 Answers   Microsoft,






plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............

2 Answers   Wipro,


write a program for area of circumference of shapes

0 Answers  


#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }

1 Answers  


how can i cast a char type array to an int type array

2 Answers  


Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])

1 Answers  


void main() { int i=5; printf("%d",i+++++i); }

3 Answers  


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256

2 Answers   HCL,


Categories