What value is stored in the result variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What value is stored in the result variable?

int x = 8, y = 5; int result = x % y;

13th Nov 2020, 8:12 AM
S M Janidu Dilsara
S M Janidu Dilsara - avatar
4 Answers
+ 13
The result will be 3 As the "%" operator returns the remainder as the answer !
13th Nov 2020, 8:22 AM
Vanshika
Vanshika - avatar
+ 5
Janidu result is 3 It's remainder operator
13th Nov 2020, 8:15 AM
NavyaSri
NavyaSri - avatar
+ 5
The variable result stores, the remainder of the division between 8 and 5. Therefore it holds, 3..
13th Nov 2020, 8:52 AM
Steve Sajeev
Steve Sajeev - avatar
+ 1
why dont you just run it and see it for you self?
26th Feb 2023, 6:11 PM
Arun CS
Arun CS - avatar