Computer Science, asked by hraj1765466, 4 months ago

if you write X equals to 1 20% 3 in c plus plus what is the value of x​

Answers

Answered by anindyaadhikari13
2

Answer:

  • If we write x = 120 % 3 in C++, then the value of x is 0.

Explanation:

The modulo operator is used to calculate the remainder obtained when a number is divided by another number.

When 120 is divided by 3, we get quotient 40 and remainder 0. So, 120 % 3 = 0

3 ) 120 ( 40

    12

  --------

       0

       0

  --------

       0

Hence, 120 % 3 = 0.

Similar questions