C Programming MCQs with answers Page - 21

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 • 833.24K Points
Coach

Q. Choose a right statement.

Code:
int a = 10 + 4.867;
  • (A) a = 10
  • (B) a = 14.867
  • (C) a = 14
  • (D) compiler error.

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

Code:
int a = 3.5 + 4.5;
  • (A) a = 0
  • (B) a = 7
  • (C) a = 8
  • (D) a = 8.0

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

Code:
float var = 3.5 + 4.5;
  • (A) var = 8.0
  • (B) var = 8
  • (C) var = 7
  • (D) var = 0.0

A

Admin • 833.24K Points
Coach

Q. Choose right statement.

Code:
int main()
{
    float c = 3.5 + 4.5;
    printf("%f", c);

    return 0;
}
  • (A) 8.0
  • (B) 8.000000
  • (C) 8
  • (D) 7

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

Code:
int main()
{
    float c = 3.5 + 4.5;
    printf("%d", (int)c);

    return 0;
}
  • (A) 8.0
  • (B) 8.000000
  • (C) 7
  • (D) 8

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

Code:
int a = 5/2;
int b = 5.0/2;
int c = 5 / 2.0;
int d = 5.0/2.0;
  • (A) a = 2, b = 2, c = 2, d= 2
  • (B) a = 2, b = 2.0, c = 2, d= 2.0
  • (C) a = 2, b = 2.5, c = 2.5, d= 2.5
  • (D) a = 2.5, b = 2.5, c = 2.5, d= 2.5

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

Code:
float a = 5/2;
float b = 5/2.0;
float c = 5.0/2;
float d = 5.0/2.0;
  • (A) a=2.5, b=2.5, c=2.5, d=2.5
  • (B) a=2, b=2.5, c=2.5, d=2.5
  • (C) a=2.0, b=2.5, c=2.5, d=2.5
  • (D) a=2.0, b=2.0, c=2.0, d=2.0

A

Admin • 833.24K Points
Coach

Q. If both numerator and denominator of a division operation in C language are integers, then we get.?

  • (A) Expected algebraic real value
  • (B) Unexpected integer value
  • (C) Compiler error.
  • (D) None of the above

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

Code:
int var = 3.5;
  • (A) a = 3.5
  • (B) a = 3
  • (C) a = 0
  • (D) Compiler error

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

Code:
int main()
{
    int var = 3.5;;
    printf("%f", var);

    return 0;
}
  • (A) 3.500000
  • (B) 3
  • (C) 3.5
  • (D) 0.000000

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