C Programming Quiz

C Programming Quiz

 



C Programming Quiz contain set of 10 MCQ questions for C Programming MCQ which will help you to clear beginner level quiz.



1. How would you round off a value from 1.66 to 2.0?
A. ceil(1.66)  
B. floor(1.66)
C. roundup(1.66)
D. roundto(1.66)
 
2. By default a real number is treated as a
A. float
B. double
C. long double
D. far double
 
3. Is the following statement a declaration or definition? extern int i;
A. Declaration 
B. Definition
C. Function
D. Error
 
4. When we mention the prototype of a function?
A. Defining
B. Declaring
C. Prototyping
D. Calling
 
5. Which bitwise operator is suitable for turning off a particular bit in a number?
A. && operator
B. & operator
C. || operator
D. ! operator
 
6. In which numbering system can the binary number 1011011111000101 be easily converted to?
A. Decimal system
B. Hexadecimal system
C. Octal system
D. No need to convert
 
 
7. In which stage the following code  #include<stdio.h> gets replaced by the contents of the file stdio.h
A. During editing
B. During linking
C. During execution
D. During preprocessing
 
8. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
A. The element will be set to 0.
B. The compiler would report an error.
C. The program may crash if some important data gets overwritten.
D. The array size would appropriately grow.
 
9. What does the following declaration mean? int (*ptr)[10];
A. ptr is array of pointers to 10 integers
B. ptr is a pointer to an array of 10 integers
C. ptr is an array of 10 integers
D. ptr is an pointer to array
 
10. In a file contains the line “I am a boy\r\n” then on reading this line into the array str using fgets(). What will str contain?
A.”I am a boy\r\n\0″
B.”I am a boy\r\0″
C.”I am a boy\n\0″    
D.”I am a boy”