Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Q1(add two numbers)

1)Algorithm

Step1=Start

Step2=enter the first number N1

Step3=enter the second number N2

Step4=calculate the addition (add=N1+N2)

Step5=display addition (add)

Step6=end

2)Flowchart 3) Pseudo code

Start Declare=N1+N2
Read=N1,N2
Input N1
Add=(N1+N2)

Input N2 Display add

Add=(N1+N2)

Display Add

Stop
Q1)

II. Subtract

Step1=Start

Step2=enter the first number N1

Step3=enter the second number N2

Step4=calculate the subtraction (sub=N1-N2)

Step5=display subtraction (sub)

Step6=end

Start
Pseudo Code
Input=N1 Declare=N1,N2
Input=N2 Read=N1,N2

sub=N1-N2 Sub=N1-N2
Display sub

Display Sub

Stop

You might also like