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
  • Draw a Raptor flowchart that inputs 50 integer numbers and accumulates only the input integer num...

    Draw a Raptor flowchart that inputs 50 integer numbers and accumulates only the input integer numbers that are odd and less than 45. Display the final accumulated value before ending the flowchart. Hint: MOD operators both give the remainder when the value on the left of the operator is divided by the operator on the right. Use MOD operator to check whether an integer number is odd or even. number mod 2 returns 1 , then the number is odd....

  • You can draw the flowchart using the Word's drawing tool, or draw the flowchart on a...

    You can draw the flowchart using the Word's drawing tool, or draw the flowchart on a piece of paper, take a picture, insert it here or save it in the submission folder The program reads an unspecified number of integers until a zero is entered. While the program reads each number it counts the number of positive numbers and the number of negative numbers that have been entered and sum up the values of the numbers entered. After the user...

  • Write a program that takes in two integers and finds the remainder of the first integer...

    Write a program that takes in two integers and finds the remainder of the first integer divided by the second integer, WITHOUT USING THE MOD OPERATOR. You may not use the modulus operator to do this, you are to use a looping construct to do this. C++

  • How can I construct a program (pseudocode and flowchart with flowgorithm) to report the remainder of...

    How can I construct a program (pseudocode and flowchart with flowgorithm) to report the remainder of N/D division, where N and D are integers using the mod (or modulus or modulo) operator or function) and improve the code to test if N is an odd number.

  • Write a python code to determine the factors of a positive number N entered by the...

    Write a python code to determine the factors of a positive number N entered by the user and their sum. For instance, if N=10 its factors are: 1, 2, 5, 10. Hint: You can use the mod or % operator to compute the remainder of an integer division. Test the program with N=100.

  • Q1. Draw flowchart to find the average of 10 positive numbers. [Hint: Read the number in...

    Q1. Draw flowchart to find the average of 10 positive numbers. [Hint: Read the number in a loop, add them if it is positive and then find average] Q2. Draw flowchart to read 5 numbers from a user and then find the second largest number of them.

  • the user should be prompted to enter an integer and then your program will produce another...

    the user should be prompted to enter an integer and then your program will produce another integer depending on whether the input was even or odd. The following is an example of what you might see when you run the program; the input you type is shown in green (press Enter at the end of a line), and the output generated by the program is shown in black text. Enter an integer: 1234 Number is even, taking every other digit...

  • Draw a flowchart for the program that will read an unknown number of ages. (0 is...

    Draw a flowchart for the program that will read an unknown number of ages. (0 is a valid age used for a baby.) The user will enter a negative number if there are no more ages to enter. The program will output the average age and youngest and oldest ages. If no ages were entered, display “No ages were entered”

  • Program : Write a complete C++ program that Input: Read a positive integer from the keyboard...

    Program : Write a complete C++ program that Input: Read a positive integer from the keyboard (user) with proper prompt text and save it to a variable. The integer have up to five digits. Processing: From the right most digit, extract every digit from the input integer using modular operator %then save the digit to a separate variable. Remove the right most digit from the integer using integer division operator /. Repeat above two steps till all digits have been...

  • Summary: Write a C program that prompts the user to enter 2 positive integer numbers, display...

    Summary: Write a C program that prompts the user to enter 2 positive integer numbers, display the numbers in 3 formats. Then check, whether the larger of the 2 is evenly divisible by the smaller. Detail: Write a complete C program, more complex than the typical "hello world" program. Prompt the user to enter 2 integer numbers that are not negative. After either entry, display that number again. Print the smaller in hexadecimal, in decimal, and in octal format. Include...

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