Question: Q 3 . Logarithm ( Iterative algorithm ) ( 1 5 pts ) Get a user input of a positive integer number: A Get a

Q3. Logarithm (Iterative algorithm)(15 pts)
Get a user input of a positive integer number: A
Get a user input of zero or a positive integer number: B
A is a base and B is an exponent of A
Calculate C= Log AB
Print C
Define variables A, B, and C (specifically these names).
Pseudo code (may have a bug. Please make sure the correctness)
Func Main ():
Get A and B
C =0
While B >1
B = Div(B, A)
C +=1
Print C
End_Main
Func Div(E, F)
V =0
While E >0
E = E - F
V +=1
Return V
End_Div

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 Programming Questions!