Remainder | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Remainder

I'm trying to get sum to equal the remainder of num * 3, which should be 1, but I'm struggling. I know there should be a % somewhere, but not sure where. Any help would be appreciated. int num = 10; sum = num * 3;

24th Feb 2021, 1:47 PM
Brian Curran
Brian Curran - avatar
2 Respostas
+ 1
Brian Curran Use modulus operator (%) not multiplication operator.
24th Feb 2021, 1:58 PM
AĶ¢J
AĶ¢J - avatar
0
Cheers AJ!
2nd Mar 2021, 8:13 AM
Brian Curran
Brian Curran - avatar