main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
hai
Explanation:
\n - newline
\b - backspace
\r - linefeed
Is This Answer Correct ? | 93 Yes | 13 No |
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() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above
Write a procedure to implement highlight as a blinking operation
write a program to count the number the same (letter/character foreg: 's') in a given sentence.
main() { printf("%x",-1<<4); }
Is the following code legal? struct a { int x; struct a b; }
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }
Program to find the largest sum of contiguous integers in the array. O(n)
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }
main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }
write a program to find out roots of quadratic equation "x=-b+-(b^2-4ac0^-1/2/2a"
int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p