C Online Quiz – Learn the Strategy, Earn the Knowledge

After completing fresher and intermediate levels of C quiz, it is the right time to face an advanced level of C MCQ’s. In this C online quiz get all the advanced and scenario-based quiz questions and answers. This C Online Quiz is meant for those who are-

  • Willing to sharpen their skills.
  • Preparing for aptitude/interviews/tests etc.

So, what are you waiting for?

Start this C Quiz now and boost your confidence.

C Online Quiz Questions

Q.1 Which of the following is the correct way to declare a function pointer where ‘pointer’ is the pointer to the function and ‘function; is the name of the function

Correct! Wrong!

Q.2 In what way are both declarations different from each other
int display();
extern int display();

Correct! Wrong!

Q.3 Predict the output of the following segment of code:
// ASSUME 64-bit compiler
// Add stdio.h and stdlib.h header file in below code

int main()
{
struct DataFlair
{
int value;
struct DataFlair *link;
};
struct DataFlair *x, *y;
x = (struct DataFlair *) malloc(sizeof(struct DataFlair));
y = (struct DataFlair *) malloc(sizeof(struct DataFlair));
printf("%ld %ld",sizeof(x),sizeof(y));
return 0;
}

Correct! Wrong!

Q.4 Which of the following statements is true about structures and unions?

Correct! Wrong!

Q.5 Predict the output of the following segment of code:
// ASSUME 64-bit compiler
// Add stdio.h header file in below code

struct DataFlair
{
int a;
float b;
char array[20];
}d;
int main()
{
printf("%ld", sizeof(struct DataFlair));
return 0;
}

Correct! Wrong!

Q.6 Which operator is used to check if a particular bit is on or off?

Correct! Wrong!

Q.7 Predict the output of the following segment of code:If n and p are unsigned int variables in a C program. We wish to set p to nC3. If n is large, which of the following statements is most likely to set p correctly?

Correct! Wrong!

Q.8 Predict the output of the following segment of code:
// Add stdio.h header file in below code

int main()
{
if(sizeof(double) > -1)
printf("M");
else
printf("m");
return 0;
}

Correct! Wrong!

Q.9 Predict the output of the following segment of code:
// Add stdio.h header file in below code

int main()
{
char result = 125;
result = result + 5;
printf("%d", result);
return 0;
}

Correct! Wrong!

Q.10 Out of the following declarations, which one is invalid?

Correct! Wrong!

Hope you enjoyed!

How many questions did you answer correctly? Share your experience in the comment section!

It’s not the end, prepare yourself for upcoming Interviews with latest C Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.