103k views
4 votes
.

Step 1: Input a positive integer A and let B = 1
Step 2: Let C = A/B. If C is an Integer print B
Step 3: If B otherwise go to step 4.
Step 4: Stop
.
Let's try this algorithm for A = 6

User Shloimy
by
8.7k points

1 Answer

8 votes

Answer:

The value of B (which is 1) will be printed

Step-by-step explanation:

Given

The above algorithm

A = 6

Required

Determine the outcome

Step 1: A = 6, B = 1

Step 2: C = A/B = 6/1 = 6

Step 3: If C is an integer print B.

Is 6 an integer? Yes.

So, the value of B (which is 1) will be printed

User Relysis
by
7.9k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.