Why the result of 25 % 7 is 4? I don't understand | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why the result of 25 % 7 is 4? I don't understand

Int x = 25 % 7 Console.WriteLine (x)

6th Apr 2019, 6:38 AM
Nelson Martínez
Nelson Martínez - avatar
2 Answers
+ 5
% operator gets the remainder of the operation. 25 / 7 = 3 remainder 4
6th Apr 2019, 6:44 AM
Lambda_Driver
Lambda_Driver - avatar
+ 1
Thanks, now I understand
6th Apr 2019, 6:45 AM
Nelson Martínez
Nelson Martínez - avatar