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 test(int * , int *);
void main()
{
  int a = 5 , b = 6;
  test(&a,&b);
  printf("%d %d",a,b);
}
void test(int *p, int *q)
{
  *p = *p * *q;
  *q = *p + *q;
  *p = *p - *q;
}

-6 36
6 36
36 6
-42

2. Which languages necessarily need heap allocation in the run time environment?

Those that support recursion
Those that use dynamic scoping
Those that use global variables
Those that allow dynamic data structures

3. Which of the following is correct mathematical operations in C Programming?

sqrt
pow
ceil
All of the above

4. Union differs from structure in the following way

All members are used at a time
Only one member can be used at a time
Union cannot have more members
Union initialized all members as structure

5. What will be output for the following code?

#include<stdio.h> 
int main() 
{ 
    double x = 1.2; 
    int sum = (int)x + 1; 
  
    printf(""sum = %d"", sum); 
  
    return 0; 
} 

sum = 2
sum = 1
sum = 0
sum = 3

6. What is the output of this program?

#include <stdio.h>
int main(){
    FILE *fp;
    char *str;
    fp=fopen("demo.txt","r");// demo.txt :you are a good programmer
    while(fgets(str,6,fp)!=NULL)
    puts(str);
    fclose(fp);
    return 0;
}

you are a good programmer
e a good programmer
you ar
you are

7. The C library function double fmod(double x, double y) returns the remainder of x divided by y.

log10(double x, double y)
fabs(double x, double y)
fmod(double x, double y)
floor(double x, double y)

8. In Implicit type conversion, If an operand of type long double is present in the expression, then the corresponding operand will also be converted to?

double 
long double
int
float 

9. To detect and handle runtime errors is the purpose of error handling in C.

Yes
No
Can be yes or no
Can not say

10. Select a function which is used to write a string to a file?

pits()
putc()
fputs()
fgets()

Results