C Programming Questions & Answers: part13

Software Programming : C Programming QUESTIONS AND ANSWERS :: part13 : 1 to 5

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

 1.The storage class of a local variable is Auto Static Extern Register Default. ANSWER : Auto Explanation :
 2.What is the value of the variable c after the switch statement below? x = 3; switch ( x ) { case 1 : c = 'A'; break; case 2 : c = 'B'; break; case 3 : c = 'C'; break; default: c = 'F'; break; } S B C F AB. ANSWER : C Explanation : 3 matches the case :3 and C will be printed.
 3.What is the return value of the following function if the function is called as int value = fun(6); int fun(int n) { if( n = = 1 || n = = 2) return 1; else return( fun(n-1) + fun(n-2) ); } 1 2 Syntax error 8 5. ANSWER : 8 Explanation : D is the right choice based on the recursive call.
 4.Which of the following is the function prototype of a function f1 that receives an int pointer and float reference and returns an int pointer? int f1(int &, float *) float* f1(float &, int &) int* f1 (int *, float &) int f1 *(int *, float &) int f1(&int,*float). ANSWER : int* f1 (int *, float &) Explanation : C is the right choice according to the statement .
 5.m = 5 and y = ++m. The value of m and y after incrementation is m is 5 and y is 5 m is 5 and y is 6 m is 6 and y is 6 m is 6 and y is 5 m is 7 and y is 5. ANSWER : m is 6 and y is 5 Explanation : First m is incremented and then y is initialized.

More C Programming QUESTIONS AND ANSWERS available in next pages

Health is the greatest gift, contentment is the greatest wealth -Buddha
Failure defeats losers, failure inspires winners.-Robert T. Kiyosaki