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

how to delete an element in an array

2 Answers   IBM,


Sir... please give some important coding questions asked by product companies..

0 Answers  


const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above

1 Answers   emc2, HCL,


#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  


Write a procedure to implement highlight as a blinking operation

2 Answers  






Program to Delete an element from a doubly linked list.

4 Answers   College School Exams Tests, Infosys,


#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }

3 Answers  


pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"

2 Answers  


void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }

1 Answers   Honeywell,


¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...

3 Answers  


Develop a routine to reflect an object about an arbitrarily selected plane

0 Answers  


Write a C program to add two numbers before the main function is called.

11 Answers   Infotech, TC,


Categories