0% found this document useful (0 votes)
2 views2 pages

Algorithm

The document outlines algorithms for various mathematical calculations including simple interest, temperature conversion, days conversion, finding the largest number, solving quadratic equations, generating Fibonacci series, and checking for Armstrong numbers. Each algorithm consists of a series of steps starting from initialization, reading input, performing calculations, and displaying results. The algorithms are structured in a clear and sequential manner for easy understanding and implementation.

Uploaded by

nehaahhh.07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Algorithm

The document outlines algorithms for various mathematical calculations including simple interest, temperature conversion, days conversion, finding the largest number, solving quadratic equations, generating Fibonacci series, and checking for Armstrong numbers. Each algorithm consists of a series of steps starting from initialization, reading input, performing calculations, and displaying results. The algorithms are structured in a clear and sequential manner for easy understanding and implementation.

Uploaded by

nehaahhh.07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Simple Interest

Algorithm:

Step 1: Start
Step 2: Declare n, p, r, si
Step 3: Read p, r, n
Step 4: Calculate si = (p*r*n)/100
Step 5: Display si
Step 6: Stop

Temprature conversion
Algorithm

Step 1: Start
Step 2: Declare c, f
Step 3: Read c
Step 4: Calculate f = (c * 9 / 5) + 32
Step 5: Display f
Step 6: Stop

Days convertion
Algorithm

Step 1: Start
Step 2: Declare tdays, m, d
Step 3: Read tdays
Step 4: Calculate m = tdays / 30
Step 5: Calculate d = tdays % 30
Step 6: Display m and d
Step 7: Stop

Largest number
Algorithm

Step 1: Start
Step 2: Declare a, b, c
Step 3: Read a, b, c
Step 4: If a > b and a > c, print a
Step 5: Else if b > c, print b
Step 6: Else print c
Step 7: Stop
Quadratic equation
Algorithm:

Step 1: Start
Step 2: Declare a, b, c, d, x1, x2
Step 3: Read values of a, b, c
Step 4: Calculate d = b*b - 4*a*c
Step 5: If d > 0
Calculate x1 = (-b + √d) / (2*a)
Calculate x2 = (-b - √d) / (2*a)
Step 6: Else if d == 0
Calculate x1 = x2 = -b / (2*a)
Step 7: Else (d < 0)
Roots are imaginary
Step 8: Display x1 and x2
Step 9: Stop

Fibonacci series
Algorithm:

Step 1: Start
Step 2: Declare n, a=0, b=1, c, i
Step 3: Read n
Step 4: Use loop from i = 0 to n-1
Step 5: Display a
Step 6: Calculate c = a + b
Step 7: Update a = b, b = c
Step 8: Repeat loop
Step 9: Stop

Armstrong numbers
Algorithm:

Step 1: Start
Step 2: Read num
Step 3: Set sum = 0 and temp = num
Step 4: While temp > 0
Step 5: rem = temp % 10
Step 6: sum = sum + (rem * rem * rem)
Step 7: temp = temp / 10
Step 8: If sum == num, print "Armstrong Number", else print "Not Armstrong Number"
Step 9: Stop

You might also like