Multiple choice technology programming languages

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

  1. 1

  2. 0.08642

  3. 0

  4. 7

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Due to integer division in C/C++, 7/9 evaluates to 0. Multiplying 0 by 9 yields 0. Floats or doubles are not used unless explicitly cast or written as literals like 7.0.