C Programming Questions & Answers: part9



Software Programming : C Programming QUESTIONS AND ANSWERS :: part9 : 11 to 15

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

11.What is the output of the following program? # include void main() { int a=5, *pa=&a, b=0, *pb=&b, **ppa=&pa; pb=pa; a += *pb += **ppa; printf(� %d, � �%d, � �%d�, *pa, b, **ppa); }

20, 0, 20
20, 20, 20
Syntax Error
0, 20, 0
0, 20, 20.

12.What is the return value of the following function if the function is called as int value = fun(10); int fun(int n) { if( n = = 1 || n = = 2) return 0; else return( n-1 + fun(n-2) ); }

20
26
22
24
0.

13.The expression (( fileptr = fopen(�somefile�, �w�)) == NULL ) would be true if

The file somefile is read only
May be the fileptr is not declared as a FILE pointer
The file somefile does not exist while fopen function is being executed
The file somefile could not be created for writing
Both (opt2) and (opt3) above.

14.If the following loop is implemented then .. { static int x; do { --x; printf( �%d�, x++); }while( x >= 0); }

The program will not enter in the loop
There will be a compilation error reported
The loop will run infinitely
A run time error will be reported
It prints 0 once and terminates the do � while loop successfully.

More C Programming QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
Identify your problems but give your power and energy to solutions- Tony Robbins