Computer Science, asked by royantonyfff, 4 months ago

x=++h % 5. If h=5 initially evaluate​

Answers

Answered by BrainlyProgrammer
1

Answer:

++h is a prefix increment (means first increase then calculate) . So as soon as the control reaches the statement value of h will become 6

x=++h%5; //value of h increased due to

>>>6%5 //prefix increment. % operator

>>> 1 //will return the remainder .hence the correct answer is 1.

Answered by Oreki
2

After Execution:

   x = 1

Explanation:

   > x = ++h % 5, h = 5,

   > x = 6 % 5

   > x = 1

Similar questions