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. What will be output for the following code?

Error
5
6
2

2. What is the output of this program ?

#include <stdio.h>
static struct student
{
  int a;
  int b;
}
  struct_var{2,3};
int main()
{
  printf("%d %d",struct_var.a,struct_var.b);
  return 0;
}

Runtime Error
Improper representation of structure variable
Compilation error
2 3

3. Switch statement accepts.

int
char
long
All of the above

4. The process in which a function calls itself directly or indirectly is called?

Recursion
Type Conversions
Constant
Abstract Classes

5. The parameter passing mechanism for an array is

call by value
call by reference
call by value-result
None of the above

6. How many times letsfindcourse will be printed?

#include <stdio.h>
int main()
{
    int i = -5;
    while (i <= 5)
    {
        if (i >= 0)
            break;
        else
        {
            i += 1;
            continue;
        }
        printf("letsfindcourse");
    }
    return 0;
}

5 times
10 times
0 times
Infinite times

7. Which of these is true about embedded C?
i)Embedded C is the extension of C programming language
ii)Embedded C is used to develop micro controller based applications.
iii)Embedded C includes features not available in normal C like fixed-point arithmetic, named address spaces, and basic I/O hardware addressing.

Only i & ii
Only i & iii
Only ii & ii
All of the above

8. Which of the following share a similarity in syntax? 1. Union 2. Structure 3. Arrays 4. Pointers

3 and 4
1 and 2
2 and 3
All of the above

9. _______________ is a synchronization primitive used to prevent multiple threads from accessing a shared resource simultaneously.

mutex
semaphore
deadlock
race

10. What will be the output of the program?

 int a=2,b=2;
 if(a && 0) 
     b=0;
 else 
     b*=10;
  printf("%d",b);

0
20
2
None of the above

Results