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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!