Question: I need help to write a C++ program where -17 Modulus 26 will equal 9. I know there is a modulus operator, %, in C++.
I need help to write a C++ program where -17 Modulus 26 will equal 9. I know there is a modulus operator, %, in C++. However, when I try to use the modulus operator, I get -17 % 26 = -17. This only happens when I use negative numbers.
-17 Modulus 26 = 9
-17 %-26 = -17
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
