C Programming Questions & Answers: part9



Software Programming : C Programming QUESTIONS AND ANSWERS :: part9 : 6 to 10

Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :

6.The getchar() library function

Returns a character when any key is pressed
Returns multiple characters when the keys are pressed
Returns multiple characters when the keys are pressed followed by enter key
Both (opt2) and (opt3) above
Returns a single character when the keys are pressed followed by enter key.

7.What would be the values assigned to a, b, c if the following statement is extended with input data item 123456 scanf(�%d %d %d�, &a, &b, &c );

a=12, b=34, c=56
a=123456 and nothing is assigned to b, c
a=1, b=3, c=5
a, b are not assigned any thing but c=123456
a=123456, b=0, c=0.

8.What is the output of the following program # include struct temp { int j, i; }a; void fun(struct temp *p) { printf(�%d, �, *p); p++; printf(�%d�, *p); } void main() { struct temp *z = &a; z->i = 1, z->j = 10; fun(z); }

10, 10
10, 1
1, 10
0, 10
10, 0.

9.If a=Oxaa and b=a<<1 then

b=2a
b=a/2
a=b-1
b=a-1
b=a.

10.Choose the correct output for the following given program. #162. Choose the correct output for the following given program. # include void fun(int a, int b, �) { int i=0, *p = &b; for( printf(� �); i

Syntax error
1, 2, 3, 4
run time error
0, 1,2,3
1, 1,2,3.

More C Programming QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
Innovation distinguishes between a leader and a follower.-Steve Jobs