Online C Programming Test – Free MCQ’s to test your C Skills

Are you looking for a test to help you analyze how much you know about C programming? You have landed on the right page. This Online C Programming Test is specially designed for you by industry experts. This C Quiz will help you to boost your confidence and help you to face any challenge.

Hope you scored well in our C Multiple Choice Questions (MCQ); now, it’s time to face the second level. Revise all the important concepts with this C Programming Quiz.

All the best!!

Keeping you updated with latest technology trends, Join DataFlair on Telegram

Online C Programming Test

Q.1 Which of the following has a global scope in the program?

Correct! Wrong!

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

int main()
{
int array[10] = {3, 0, 8, 1, 12, 8, 9, 2, 13, 10};
int x, y, z;
x = ++array[2];
y = array[2]++;
z = array[x++];
printf("%d %d %d", x, y, z);
return 0;
}

Correct! Wrong!

Q.3 Which of the following statements about functions is false?

Correct! Wrong!

Q.4 What is the correct way of treating 9.81 as a long double?

Correct! Wrong!

Q.5 Which function would you use to convert 1.98 to 1?

Correct! Wrong!

Q.6 Which of the following statements about the null pointer is correct?

Correct! Wrong!

Q.7 Which of the following statements about unions is incorrect?

Correct! Wrong!

Q.8 What is the range of double data type for a 16-bit compiler?

Correct! Wrong!

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

int main()
{
int x = 6;
int y = 4;
int z;
if(!x >= 5)
y = 3;
z = 2;
printf("%d %d", z, y);
return 0;
}

Correct! Wrong!

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

int main()
{
int a,b,c;
a = b = c = 10;
c = a++ || ++b && ++c;
printf("%d %d %d",c, a, b);
return 0;
}

Correct! Wrong!

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

#define PRODUCT(x) (x*x*x*x)
int main()
{
int x = 2;
int result = PRODUCT(x++);
printf("%d %d", x, result);
return 0;
}

Correct! Wrong!

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

int  main() 
{ 
unsigned int a = -1; 
int b = ~0; 
int result;
if (b == a)
printf("equal");
else
printf("unequal"); 
return 0; 
}

Correct! Wrong!

Hope you liked this online C programming test. But this is not the end; prepare yourself for the next level with our advanced level of C Quiz.

If you have any queries and suggestions, share them with us!

15 Responses

  1. ramyasri says:

    very nice
    its very horror and terrible

  2. JEEVACSE says:

    very useful for my study

  3. Vanshika Arora says:

    ans to ques 5 should be floor()

    • Janani says:

      Yes, it should be floor(). While ceil(x) returns the smallest integer that is greater than or equal to x (i.e : rounds up the nearest integer and floor(x) returns the largest integer that is smaller than or equal to x (i.e : rounds downs the nearest integer).

  4. Sweety Baggie says:

    Hi,I got Coronavirus.

  5. Ramya Thiurmalisamy says:

    Can anyone give me a explanation to all questions?

  6. Gagandeep Shukla says:

    Q-11:
    #define PRODUCT(x) (x*x*x*x)
    int result = PRODUCT(x++);

    Undefined behaviour. clang gives warning: multiple unsequenced modifications to ‘x’ [-Wunsequenced] but produces 6 120
    MSVC does multiplication first and then does increment thus giving 6 16
    and both are correct to implement undefined behaviour the way they see fit

  7. Jaydeep says:

    Can give anyone example all question

  8. Jaydeep says:

    Example all question

  9. Vaibhav says:

    Test is very easy

  10. Mageshwari.N says:

    Test to good

  11. P.keerthana says:

    Good

  12. Janani says:

    Q5.) floor().
    While ceil(x) returns the smallest integer that is greater than or equal to x (i.e : rounds up the nearest integer and floor(x) returns the largest integer that is smaller than or equal to x (i.e : rounds downs the nearest integer).

  13. Gaurav Jitendra Birla says:

    Can I get certificate of it?

  14. Kondabala sindhu says:

    nice

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.