Home |
Write |
148 members |
USA


Join with Aptibook
http://www.aptibook.com
C programming questions and answers in Objective type
Note: Objective type question pattern is used here.
Out of four choices, you are requested to select the best possible answer(s).

1. Which of the following is an illegal value for the case in a switch block ?

A. ‘a’

B. 1.0

C. 200

D. ‘T’

 Difficulty: 

2. What is the output of the following program?

int main(int argc,char **argv) 
{ 
      int iIndex=0; 
     for( ;  iIndex<10;  iIndex++) 
     { 
          if (iIndex%2 == 0) 
              printf("%d ", iIndex); 
          else 
             continue; 
        } 
     return 0; 
}

A. 0 2 4 6 8

B. 1 3 5 7 9

C. 2 4 6 8

D. None

 Difficulty: 

3. The function strcmp will return _________ if the two strings are same

A. 1

B. -1

C. Non-zero integer

D. 0

 Difficulty: 

4. Which of the following statement(s) is/are correct?
1) All the arguments of a function must be of the same data type.
2) An array can be passed as an argument to a function.
3) Every function must return a value.

A. All are true

B. 1, 2, 3 are true

C. 2 is true

D. 3 is true

 Difficulty: 

5. Find the output of the following code snippet:

#include  

int main(int argc, char ** argv) 
{    
   int iCount; 
   for (iCount = 0; iCount < 10; iCount++) 
   { 
         iCount = iCount + 1; 
         printf("%d  ",iCount); 
   } 
   return 0; 
} 

A. 0 1 2 3 4 5 6 7 8 9

B. 10

C. 0

D. 1 3 5 7 9

 Difficulty: