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 scope of static class specifier?

Within block
Within Program
Global Multiple files
None of the above

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

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

4. What is the maximun number of dimensions an array in C may have?

Two
eight
sixteen
Theoratically no limit. The only practical limits are memory size and compilers

5. perror displays the string you pass to it, followed by a colon, a space, and then the textual representation of the current errno value.

TRUE
FALSE
Can be true or false
Can not say

6. Threads operate faster than processes.

TRUE
FALSE
Can be true or false
Can not say

7. What is the output of this program?

  #include <stdio.h>
  int var = 20;
  int main()
  {
    int var = var;
    printf("%d ", var);
    return 0;
  }

Garbage Value
20
Compiler Error
None of these

8. Which of the following data type will throw an error on modulus operation(%)?

int
char
float
long

9. What is the output of this program 32 bit c compiler ?

#include <stdio.h>
int main()
{
  int a = 1;
  printf("%d %p",a,a);
   return 0;
}

Runtime error
1 00000001
1 1
%p is not a format specifier

10. The following code is an example of?

double da = 4.5;
double db = 4.6;
double dc = 4.9;

//explicitly defined by user
int result = (int)da + (int)db + (int)dc; 

printf(""result = %d"", result);

Implicit Type Conversion
Explicit Type Conversion
Error
Can not Say

Results