C Programming Quiz


Play this C quiz that will help you to excel in C certification exams, placements etc. This C programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This C programming test enables you to assess your knowledge of C programming.

Take the Free Practice Test



C MCQs

Practice C MCQ Questions, which will help you in understanding programming concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

C Quiz

Try Free C Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

C Quiz

1. Which of the following typecasting is accepted by C?

Widening conversions
Narrowing conversions
Widening & Narrowing conversions
None of the above

2. How many times value of j is checked in the below code ?

#include 
    int main()
    {
        int j = 0;
        do {
            j++;
            printf("");
        } while (j < 5);
    }

3
4
5
1

3. Is the NULL pointer same as an uninitialised pointer?

Yes
No
May Be
Can't Say

4. What is the output of this program?

    #include <stdio.h>
    int main()
    {
        int i;
        for (i = 0;i < 5; i++)
        int a = i;
        printf("%d", a);
    }

Syntax error in declaration of a
No errors, program will show the output 5
Redeclaration of a in same scope throws error
a is out of scope when printf is called

5. The size of the following union, where an int occupies 4 bytes of memory is

union demo
{
  float x;
  int y;
  char z[10];
};

8 byte
4 byte
10 byte
18 byte

6. Local variables are stored in an area called ___________

Heap
Permanent storage area
Free memory
Stack

7. What is the output of this program?

int main()
{
 
    int a = 1, b = 0;
    int c = a%2 ? a++ : a-- ? a=0 : ++b ? b = 2 : b++ ;
    printf("%d", c);
    return 0;
}

1
2
3
0

8. The time() function is defined in __________ header file.

ctime.h
time.h
clock.h
date.h

9. asctime() structure contents are interpreted by this function as calendar time.

Yes
No
Can be yes or no
Can not say

10. What will be output for the following code?

#include <stdio.h>
main()
{
    int num=5;
    int fun(int num);
    printf(""%d"",fun(num));
}
int fun(int num)
{
    if(num>0)
        return(num+fun(num-2));
}

6
7
8
9

Results