0
C#
Please help... how do I write if statements for an equation that states "A divided by B the reminder 0 or 1"
4 Answers
+ 2
Nyaxie
Modulus operator (%) will help you.
A%B returns reminder
+ 2
Nyaxie
Doesn't it looks like a homework QUESTIOn? I think it's the same!
+ 1
Nyaxie
int A = Convert.ToInt32(Console.ReadLine());
int B = Convert.ToInt32(Console.ReadLine());
try {
Console.Write("Reminder = " + A % B);
} catch(Exception e) {
Console.Write("B can't be 0");
}
0
AJ #Learn With Me đ¨âđť okay thank you. Can you help me with the right codes to use for it to run well