Algorithms
Write an algorithm to convert temperature
from Fahrenheit to Celsius
Step 1: Start.
Step 2: Input F.
Step 3: C=(5(F-32))/9.
Step 4: Display C.
Step 5: Stop.
Write an algorithm to find whether a given
number is odd or even
Step 1: Start
Step 2: [ Take Input ] Read: Number
Step 3: Check: If (Number%2 == 0) Then
Display N is an Even Number.
Otherwise/else
Display N is an Odd Number.
Step 4: Stop
Algorithm To Find Whether A Number Is
Positive Or Negative is given below:
Step1. Start
Step2. Input a number n.
Step3. If (n<0) then it is a negative integer.
Step4. Else if (n>0)then it is a positive integer.
Step5. Else, the number is equal to zero.
Step6. End.
Algorithm To Find Whether a year is leap
or not
• Step.1: Start
• Step.2: Input integer variable year
• Step.3: Check if year is divisible by 4 but not 100,
DISPLAY "leap year"
• Step.4: Check if year is divisible by 400, DISPLAY
"leap year"
• Step.5: Otherwise, DISPLAY "not leap year"
• Step.6:Stop
Write an algorithm to swap two numbers
Step 1: Start.
Step 2: Read a, b, c.
Step 3. c=a;
a=b;
b=C;
Step 4: print a, b.
Step 5: stop
Algorithm with out using a third variable
Step 1: Start
Step 2: Read the value of a, b
Step 3: a= a + b
Step 4: b= a - b
Step 5: a= a - b
Step 6: PRINT the value of a and b
Step 7: Stop