📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!

  • google app store apple app store
  • ✖

      Question

      In C, what is the output of printf("%d",

      5/2);?
      A 2.5 Correct Answer Incorrect Answer
      B 2 Correct Answer Incorrect Answer
      C 3 Correct Answer Incorrect Answer
      E Error Correct Answer Incorrect Answer

      Solution

      Integer division truncates the decimal, so 5/2 evaluates to 2 in C.

      Practice Next
      ask-question