Anda di halaman 1dari 2

erv Placement Paper January 2012:1. main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error.

b. Hello world c. Compile error d. hello world Ans: b) Hello world 2. main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O Ans: c) I am OK is not in " " 3. How will you print % character? a. printf(%) b. printf(%) c. printf(%%) d. printf(%%) Ans: c) printf(" %% "); 4. Find the output for the following C program int x=5; y= x&y

5.Find the output for the following C program Y=10; if( Y++>9 && Y++!=10 && Y++>10) {printf("%d", Y); else printf("%d", Y); } Ans. 13 6. There are total 15 people. 7 speaks french and 8 speaks spanish. 3 do not speak any language. Which part of total people speaks both languages. Ans: 1/5 7. A jogger wants to save ?th of his jogging time. He should increase his speed by how much %age. Ans: 33.33 % 8. A is an integer. Dividing 89 & 125 gives remainders 4 & 6 respectively. Find a ? Ans: 17 9. A works thrice as much as B. If A takes 60 days less than B to do a work then find the number of days it would take to complete the work if both work together? Ans. 22days 10. How many 1's are there in the binary form of 8*1024 + 3*64 + 3 Ans. 4

Anda mungkin juga menyukai