Welcome to C Programming Quiz, Entry Level !!

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

float

double

long double

far double

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

representation of void pointer

representation of null pointer

both of the above

Compilation Error

Question 3. What does the "auto" specifier do?

It automatically initializes a variable to 0

It indicates that a variable's memory will automatically be preserved

It automatically increments the variable when used.

It indicates that a variable's memory space is allocated upon entry into the block.

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

reading

writing

appending

read and write

Question 5. What function should be used to free the memory allocated by calloc() ?

dealloc();

demalloc(variable_name, 0)

free()

decalloc(variable_name, 0)

Question 6. In the following program where is the variable a getting defined and where it is getting declared?
#include<stdio.h>
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 7. Which of the following special symbol allowed in a variable name?

* (asterisk)

| (pipeline)

- (hyphen)

_ (underscore)

Question 8. 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 9. 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 10. 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