Professional Documents
Culture Documents
ALGORITHM
ALGORITHM
1. A program that accepts two numbers and checks whether they are equal or not.
Step1=start
Not equal
Input numbers
numbers
equal
print print
Step1=start
Step2=input variable even
Step3=if number mod2=0 is even print even else print odd
Step4=end
Start
Input number
Is mod2=0
No yes
Print odd
p print even
End
Step 1=start
Step 4=End
Start
Input number
No If user(s) yes
Positive
Step1=start
Step3= input x
Print = x metres
Step 5=end
Start
Print = x metres
End
5. A program that accepts the Cost Price of an item and the Selling Price
of an item. The program then checks whether a profit or loss was made
after selling the item.
Start
Input cp,sp
no Amount=cp<sp yes
print print
loss profit
End