Q:

Determine the result of the following expressions

0

 Determine the result of the following expressions.

(a) -30 * 3 + 21 / 5

(b) -30 + 3 * 21 / 5

(c) 30 / 3 * 21 % 5

(d) -30 / 3 * 21 % 4

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>

int main() {
  std::cout << -30 * 3 + 21 / 5 << std::endl;  // -86
  std::cout << -30 + 3 * 21 / 5 << std::endl;  // -18
  std::cout <<  30 / 3 * 21 % 5 << std::endl;  // 0
  std::cout << -30 / 3 * 21 % 4 << std::endl;  // -2

  return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now