C Programming Questions & Answers: part3



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

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

6.A static variable is one

Which can not be initialized
Which is initialized once at the commencement of execution and can�t be changed during the run time
Can�t be declared as global, but as a local only
Which is same as the auto variable but is placed at the head of the program
Retains its value throughout the life of the program.

7.What is the final value of the digit? main( ) { int digit = 0; for ( ; digit <= 9; ) printf( �%d\n�, digit++); digit *= 2; --digit; }

Error
-1
17
16
19.

8.The for statement which can precede a loop to be executed 50 times or till a boolean variable �found� becomes false is given by ( let true, false are boolean constants )

for( i=0; i<= 50 && found==true; i++ )
for( i=0; i<= 50 found==true; i++ )
for( i=0; i<= 50 found==false; i++ )
for( i=0; i<= 50 && found==false; i++ )
for( i=0; ++i<= 50 found==false;

9.What is the right choice, if the following loop is implemented { int num = 0; do { --num; printf( � %d �, num); }while( ++num >= 0 ); }

A run time error will be generated
The program will not enter into the loop
There will be a compilation error reported
The loop will run infinitely many times
Prints the value of 0 one time only.

10.Consider the following code in a C program. struct custom { int acct_no; float balance; } customer,*pc=&customer; customer�s acct_no can be accessed by

customer.acct_no
pc->acct_no
(*pc).acct_no
Both (opt1) and (opt2)
(opt1),(opt2) and (opt3).

More C Programming QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
Trust because you are willing to accept the risk, not because it’s safe or certain