Welcome to C Programming Quiz, Entry Level !!

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

dealloc();

demalloc(variable_name, 0)

free()

decalloc(variable_name, 0)

Question 2. 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 3. By default a real number is treated as a ?

float

double

long double

far double

Question 4. 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 5. Which statement will you add in the following program to work it correctly?
#include<stdio.h>
int main()
{
    printf("%f\n", log(36.0));
    return 0;
}

#include<conio.h>

#include<math.h>

#include<stdlib.h>

#include<dos.h>

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

&& operator

|| operator

& operator

| operator

Question 7. What is the purpose of "rb" in fopen() function used below in the code?
FILE *fp;
fp = fopen("source.txt", "rb");

open "source.txt" in binary mode for reading

open "source.txt" in binary mode for reading and writing

Create a new file "source.txt" for reading and writing

none of the above

Question 8. Which of the following special symbol allowed in a variable name?

* (asterisk)

| (pipeline)

- (hyphen)

_ (underscore)

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