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

PROGRAM # 01

Object:
To perform Mathematical
operations(Addition,Subtraction,Multiplication,Division and Power)
on two numbers.

Algorithm:
Step1: Start
Step2: Declare variables a and b.
Step3: Read variables a and b.
Step4: Add a and b (a+b) and Display their addition.
Step5:Subtract a and b (a-b) and Display their subtraction.
Step6:Multiply a and b(a*b) and Display their Multiplication.
Step7:Divide a and b(a/b) and Display their Division.
Step8:Take Power of a and b and Display their answer.
Step9: Stop.

Program # 02
Object:
To Convert Cartesian Co-ordinate to Polar Co-ordinate & Polar Coordiante to Cartesian Co-ordiante.

Algorithm:
Step1: Start.
Step2: Declare vaariables x,y and ch.
Step3: Provide Two choices
a.)
b.)

Cartesian Coordinate to Polar Coordinate


Polar Coordinate to Cartesian Coordinate.

Step4: For Condition a,


-Read variables x and y.
-Declare variables r and theta.
-Calculate r ( r=(x2 + y2) ).
-Calculate theta (tan-1 y/x ).
-Display value of r and theta.
For Condition b.
-Declare variables r and theta.
-Read variables r and theta.
-Declare variables x and y.
-Calculate x (x=rcos(theta)).

-Calculate y (y=rsin(theta)).
-Display value of x and y.
Step5: Stop.

Program # 03
Object:
To Calculate Area of Triangle, given lengths of 3 sides.

Algorithm:
Step1: Start.
Step2: Declare variable a,b,c,p,area.
Step3: Read variables a,b and c(Lengths of triangle).
Step4: Calculate p (p=(a+b+c)/2).
Step5: Calculate area ( area = (p(p-a)(p-b)(p-c)) 1/2).
Step6: Display area of triangle.
Step7: Stop.

Program # 04
Object:
To Calculate Sum of 5-Digits.

Algorithm:
Step1: Start.
Step2: Declare variables int,num.
Step3: Read variable num(a 5-digits number).
Step4: Declare variables sum,temp,count.
Step5: Start a for loop to Calculate sum of given 5-digits.
Step6: Display the result(Sum of 5-digits).
Step7: Stop.

You might also like