CSE101 - Lec 2 (Algorithm and Flowchart)
CSE101 - Lec 2 (Algorithm and Flowchart)
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result to
sum.
sum←num1+num2
Step 5: Display sum
Step 6: Stop
Step 1: Start
Step 2: Declare variables radius and area.
Step 3: Read value of radius.
Step 4: Apply the expression as specified below
and assign the result in area
area←3.14*radius*radius
Step 5: Display area
Step 6: Stop
Step 1: Start
Step 2: Declare three variables: num1,num2 and temp
Step 3: Read values of num1 and num2
Step 4: Assign the value of num1 in temp
temp ←num1
Step 5: Assign the value of num2 in num1
num1 ←num2
Step 6: Assign the value of temp in num2
num2 ←temp
Step 7: Display swapped values of num1 and num2
Step 8:Stop