Question

Draw the flowchart of the program that will find the remainder of a positive integer entered...

Draw the flowchart of the program that will find the remainder of a positive integer entered by the user with another integer to be entered by the user, without using the remaining operator (%).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

First, we will look at the algorithm that will find the remainder of a positive integer entered by the user with another integer to be entered by the user, without using the remaining operator (%). The algorithm is as follows:

  1. Declare three variables number, divisor and remainder
  2. Read the positive integer in a variable number and the number by which we have to divide the positive integer entered by the user in a variable 'divisor'
  3. Keep on subtracting the divisor from the number and set/assign the calculated value after subtraction to the variable number, until the number becomes less than the divisor.
  4. When/if the number becomes less than the divisor, it is the required remainder and hence assign the number to the remainder variable.
  5. Print the remainder as the result.

The flowchart for the program is given below:

Start Declare integer variables number, divisor, and remainder Input and read number and divisor Yes if number< divisor NO re

Thanks!

Add a comment
Know the answer?
Add Answer to:
Draw the flowchart of the program that will find the remainder of a positive integer entered...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT