What does 7/9*9 equal (in C and C++)?

  1. 1

  2. 0.08642

  3. 0

  4. None of the Above


Correct Option: C

AI Explanation

To evaluate the expression 7/9 * 9 in C and C++, we need to consider the data types involved.

By default, when dividing two integers in C and C++, the result will be an integer, which means the decimal part will be truncated.

Let's evaluate the expression step by step:

7/9 = 0 (since both 7 and 9 are integers, the result will be an integer and the decimal part is truncated)

0 * 9 = 0 (0 multiplied by any number is 0)

Therefore, the result of the expression 7/9 * 9 in C and C++ is 0.

Hence, the correct answer is option C.

Find more quizzes: