Mid Term
1. In order to get 256 from the number 2568 we divide this number by 10 and take,
A.  Its remainder B.  The number C.  Its quotient D.  Its divisor
2. The correct syntax of do-while loop is,
A.  (condition ) while; do { statements; }; B.  { statements; } do-while (); C.  while(condition); do { statements; }; D.  do { statements; } while (condition);
3. Which of the following function(s) is/are included in stdlib.h header file?
A.  double atof(const char *nptr) B.  int atoi(const char *nptr) C.  char *strcpy ( char *s1, const char *s2) D.  

a and b only 

4. If the break statement is missed in switch statement then,
A.  The compiler will give error B.  

This may cause a logical error

C.  No effect on program D.  Program stops its execution
5. The data type before a function name represents its,
A.  

Return Type

B.  Function data C.  Function arguments D.  Function name
6. Member function tellg() returns the current location of the _____________ pointer.
A.  tellptr() B.  write() C.  seekg() D.  

get() 

7.

What does 5 | 6 , evaluate to in decimal where ‘|’ is bitwise OR operator?

A.  

3

B.  

4

C.  

5

D.  

7

8. C is widely known as development language of _______ operating system.
A.  Linux B.  Windows C.  

Unix

D.  Mac OS
9.

What will be the result of arithmetic expression 6+27/3*3?

A.  33 B.  45 C.  9 D.  30
10. How many bytes are occupied by declaring following array of characters? char str[] = “programming”;
A.  10 B.  11 C.  12 D.  13