Welcome to C Programming Quiz, Entry Level !!

Question 1. Which of the following cannot be checked in a switch-case statement?





Question 2. What will you do to treat the constant 3.14 as a long double?

use 3.14LD

use 3.14L

use 3.14DL

use 3.14LF

Question 3. In the following program where is the variable a getting defined and where it is getting declared?
int main()
    extern int a;
    printf("%d\n", a);
    return 0;
int a=20;

extern int a is declaration, int a = 20 is the definition

int a = 20 is declaration, extern int a is the definition

int a = 20 is definition, a is not defined

a is declared, a is not defined

Question 4. what is meant by (void*)0

representation of void pointer

representation of null pointer

both of the above

Compilation Error

Question 5. Which of the following operations can be performed on the file "NOTES.TXT" using the below code?
FILE *fp;
fp = fopen("NOTES.TXT", "r+");




read and write

Question 6. Which bitwise operator is suitable for turning on a particular bit in a number?

&& operator

|| operator

& operator

| operator

Question 7. Identify which of the following are declarations
1:   extern int x;
2:   float square ( float x ) { ... }
3:   double pow(double, double);



1 and 3


Question 8. A pointer is a

keyword used to create variables

variable that stores address of an instruction

variable that stores address of other variable

all of the above

Question 9. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

rem = 3.14 % 2.1;

rem = modf(3.14, 2.1);

rem = fmod(3.14, 2.1);

Remainder cannot be obtain in floating point division.

Question 10. By default a real number is treated as a ?



long double

far double