C Programming MCQs with answers Page - 22

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. What is the output of the program.?

Code:
int main()
{
    int a = 25%10;
    printf("%d", a);

    return 0;
}
  • (A) 2.5
  • (B) 2
  • (C) 5
  • (D) Compiler error.

A

Admin • 833.24K Points
Coach

Q. Can you use C Modulo Division operator % with float and int?

  • (A) Only int variables = Okay
  • (B) Only float variables = Okay
  • (C) int or float combination = Okay
  • (D) Numerator int variable, Denominator any variable = Okay

A

Admin • 833.24K Points
Coach

Q. What is the output of the C program with Modulo Division operator with - or Negative numbers.?

Code:
int main()
{
    int a = -25%-10;
    int b = -25%10;
    int c = 25%-10;
    
    printf("%d %d %d", a, b, c);

    return 0;
}
  • (A) 5 -5 5
  • (B) 5 -5 -5
  • (C) -5 -5 5
  • (D) 5 5 5

A

Admin • 833.24K Points
Coach

Q. What is the output of the program?

Code:
int main()
{
    float a = 45;
    printf("%f", a);

    return 0;
}
  • (A) 45
  • (B) 45.0
  • (C) 45.000000
  • (D) 0.000000

A

Admin • 833.24K Points
Coach

Q. What is the priority of operators *, / and % in C language.?

  • (A) * > / > %
  • (B) % > * > /
  • (C) Both % = / , * are same
  • (D) All three operators *, / and % are same.

A

Admin • 833.24K Points
Coach

Q. In C language, which Operator group has more priority between (*, / and %) and (+, -) groups.?

  • (A) Both groups share equal priority.
  • (B) (+, -) > (*, / and %)
  • (C) (+, -) < (*, / and %)
  • (D) None of the above.

A

Admin • 833.24K Points
Coach

Q. What is the Priority among (*, /, %), (+, -) and (=) C Operators.?

  • (A) (*, /, %) > (+, -) < (=)
  • (B) (*, /, %) < (+, -) < (=)
  • (C) (*, /, %) > (+, -) > (=)
  • (D) (*, /, %) < (+, -) (+, -) == (=)

A

Admin • 833.24K Points
Coach

Q. What is the output of the C statement.?

Code:
int main()
{
    int a=0;
    a = 4 + 4/2*5 + 20;
    printf("%d", a);

    return 0;
}
  • (A) 40
  • (B) 4
  • (C) 34
  • (D) 54

A

Admin • 833.24K Points
Coach

Q. What is the output of the C Program?

Code:
int main()
{
    int a=0;
    a = 10 + 5 * 2 * 8 / 2 + 4;
    printf("%d", a);

    return 0;
}
  • (A) 124
  • (B) 54
  • (C) 23
  • (D) 404

A

Admin • 833.24K Points
Coach

Q. What is the output of the C Program?

Code:
int main()
{
    int a=0;
    a = 4 + 5/2*10 + 5;
    printf("%d", a);

    return 0;
}
  • (A) 29
  • (B) 5
  • (C) 4
  • (D) 34

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