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 option is the correct representation of the following C statement?

e = a * b + c / d * f;

e = (a * (b +(c /(d * f))));
e = ((a * b) + (c / (d * f)));
e = ((a * b) + ((c / d)* f));
Both C and B

2. What is the correct syntax to declare a function foo() which receives an array of structure in function?

void foo(struct *var);
void foo(struct *var[]);
void foo(struct var);
none of the mentioned

3. Local variables are stored in an area called ___________

Heap
Permanent storage area
Free memory
Stack

4. Thread are often called as ?

heavyweight processes
lightweight processes
both a and b
None of the above

5. What is the output of this program?

#include <stdio.h>
void test(char**);

int main()
{
    char *argv[] = {"a", "b", "c", "d"};
    test(argv);
    return 0;
}
void test(char **p)
{
    char *m;
    m = (p+= sizeof(int))[-2];
    printf("%s", m);
}

a
b
c
d

6. If switch feature is used, then

Default case must be present
Default case, if used, should be the last case
Default case, if used, can be placed anywhere
None of the above

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

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

8. Where does the uninitialized data gets stored in memory?

Code segment
Data segment
BSS- Block started by symbol
Heap

9. What is the correct syntax of enum?

enum flag{constant1, constant2, constant3, ....... };
enum flag(constant1, constant2, constant3, ....... );
enum flag[constant1, constant2, constant3, ....... ];
enumflag{constant1, constant2, constant3, ....... };

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

Results