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 is the output of this program?

#include <stdio.h>
void main()
    {
        test();
        void test()
        {
            printf("1");
        }
    }

1
Compilation Error
Run Time Error
None of the above

2. Which of the following statement about for loop is true ?

Index value is retained outside the loop
Index value can be changed from within the loop
Goto can be used to jump, out of the loop
All of these

3. During preprocessing, the code #include gets replaced by the contents of the file stdio.h. Which is true?

During linking the code #include replaces by stdio.h
Yes
During execution the code #include replaces by stdio.h
During editing the code #include replaces by stdio.h

4. What will be the output of the program?

 int a=0,b=2;
 if(a=0) b=0;
 else b*=10;

0
20
2
None of the above

5. What is the output of this program?

#include <stdio.h>
int main()
{
    enum days {MON=-1, TUE, WED=4, THU, FRI, SAT};
    printf("%d, %d, %d, %d, %d, %d", MON, TUE, WED, THU, FRI, SAT);
    return 0;
}

-1 0 4 5 6 7
-1 0 1 2 3 4
0 1 2 3 4 5
Error

6. In the following loop construct, which one is executed only once always.    for(exp1; exp2; exp3)

exp1
exp3
exp1 and exp3
exp1, exp2 and exp3

7. In _______, the bodies of the two loops are merged together to form a single loop provided that they do not make any references to each other.

Loop unrolling
Strength reduction
Loop concatenation
Loop jamming

8. 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

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

10. A file written in text mode can be read back in binary mode.

Yes
No
May Be
Can't Say

Results