Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me create a psuedocode for the following questions... mod is the remainder function it is the remainder that results when a non zero

Please help me create a psuedocode for the following questions...

"mod" is the remainder function

it is the remainder that results when a non zero integer divides another integer.

suppose m mod n = r and m/n = q where m,n,q, and r are integers then m = q x n + r

9 mod 2 = 1 and 9 = 4 x 2 + 1

8 mod 2 = 0 and 8 = 4 x 2 + 0

8 mod 3 = 2 and 8 = 2 x 3 + 2

11 mod 7 = 4 and 11 = 1 x 7 + 4

22 mod 7 = 1 and 22 = 3 x 7 + 1

What is the output of the following program fragment?

num = 12

while num >= 0

if num mod 5 = 0 then

add 1 to num

else

display num

subtract 2 from num

end if

end while

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions