Welcome to C Programming Quiz, Entry Level !!

Question 1. What is the similarity between a structure, union and enumeration?

All of them let you define new values

All of them let you define new data types

All of them let you define new pointers

All of them let you define new structures

Question 2. In C, if you pass an array as an argument to a function, what actually gets passed?

Value of elements in array

First element of the array

Base address of the array

Address of the last element of array

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

float

double

long double

far double

Question 4. What are the different types of real data type in C ?

float, double

short int, double, long int

float, double, long double

double, long int, float

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

1

2

1 and 3

3

Question 6. 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 7. Which bitwise operator is suitable for checking whether a particular bit is on or off?

&& operator

& operator

|| operator

! operator

Question 8. Is there any difference between following declarations?
1:  extern int fun();
2:  int fun();

Both are identical

No difference, except extern int fun(); is probably in another file

int fun(); is overrided with extern int fun();

None of the above

Question 9. Which files will get closed through the fclose() in the following program?
#include<stdio.h>

int main()
{
    FILE *fs, *ft, *fp;
    fp = fopen("A.C", "r");
    fs = fopen("B.C", "r");
    ft = fopen("C.C", "r");
    fclose(fp, fs, ft);
    return 0;
}

"A.C" "B.C" "C.C"

"B.C" "C.C"

"A.C"

error in fclose()

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

representation of void pointer

representation of null pointer

both of the above

Compilation Error