C Programming MCQs with answers Page - 1

Here, you will find a collection of MCQ questions on C Programming. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 802.91K Points
Coach

Q. What is the first stage of compilation of a C program?

  • (A) linking
  • (B) assembling
  • (C) preprocessing
  • (D) compiling

A

Admin • 802.91K Points
Coach

Q. What is a standard library function to read 1 char at a time?

  • (A) putchar()
  • (B) printf()
  • (C) getchar()
  • (D) write()

A

Admin • 802.91K Points
Coach

Q. What is the range of a signed char variable in C?

  • (A) 0 to 255
  • (B) -128 to 127
  • (C) 0 to 127
  • (D) -128 to 255

A

Admin • 802.91K Points
Coach

Q. Which of the following is the correct output for the program given below?

Code:
#include <stdio.h>
int main ( )
{
      float floatvalue = 8.25;
      printf ("%d
 " , (int) floatvalue);
      return 0;
}
  • (A) 0
  • (B) 0.0
  • (C) 8.0
  • (D) 8

A

Admin • 802.91K Points
Coach

Q. Which of the following is valid range of long double ?

  • (A) 3.4E-4932 to 1.1E+4932
  • (B) 3.4E-4932 to 3.4E+4932
  • (C) 1.1E-4932 to 1.1E+4932
  • (D) 1.7E - 308 to 1.7E + 308

A

Admin • 802.91K Points
Coach

Q. What is the output of this C code?

Code:
#include <stdio.h>
int main()
{
   char chr;
   chr = 128;
   printf("%d
", chr);
   return 0;
}
  • (A) 128
  • (B) -128
  • (C) Depends on the compiler
  • (D) None of the mentioned

A

Admin • 802.91K Points
Coach

Q. %lf is used to display?

  • (A) long float
  • (B) double
  • (C) float
  • (D) All of above

A

Admin • 802.91K Points
Coach

Q. Modulus for float could be achieved by?

  • (A) mod(p, q);
  • (B) fmod(p, q);
  • (C) modulus(p, q);
  • (D) p % q

A

Admin • 802.91K Points
Coach

Q. Which data type is suitable for storing a number like?
25.00002500025

  • (A) double
  • (B) int
  • (C) both int and double
  • (D) float

A

Admin • 802.91K Points
Coach

Q. Which of the following % operation is invalid?

  • (A) 2 % 4f;
  • (B) 2 % 4l;
  • (C) Both 2 % 4f; and 2 % 4l;
  • (D) 2 % 4;

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ