Welcome to C Programming Quiz, Entry Level !!

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

* (asterisk)

| (pipeline)

- (hyphen)

_ (underscore)

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

&& operator

|| operator

& operator

| operator

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

character

integer

float

enum

Question 4. Which bitwise operator is suitable for turning off a particular bit in a number?

&& operator

& operator

|| operator

| operator

Question 5. 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 6. How will you free the memory allocated by the following program?
#include<stdio.h>
#include<stdlib.h>
#define MAXROW 3
#define MAXCOL 4

int main()
{
    int **p, i, j;
    p = (int **) malloc(MAXROW * sizeof(int*));
    return 0;
}

memfree(int p)

dealloc(p)

malloc(p, 0)

free(p)

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

dealloc();

demalloc(variable_name, 0)

free()

decalloc(variable_name, 0)

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