Question: 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

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!