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

Algorithms

The document outlines twelve algorithms covering various programming tasks such as swapping variables, performing arithmetic operations, calculating area and perimeter, computing simple interest, finding the largest number, checking age eligibility for a driver's license, grading based on percentage, identifying the smallest and largest numbers, generating multiplication tables, calculating the sum of digits, checking for palindromes, and displaying a pattern. Each algorithm is structured with a series of steps that guide the user from start to finish. The algorithms are designed to be simple and educational, suitable for beginners in programming.

Uploaded by

dishagangamma17
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 views6 pages

Algorithms

The document outlines twelve algorithms covering various programming tasks such as swapping variables, performing arithmetic operations, calculating area and perimeter, computing simple interest, finding the largest number, checking age eligibility for a driver's license, grading based on percentage, identifying the smallest and largest numbers, generating multiplication tables, calculating the sum of digits, checking for palindromes, and displaying a pattern. Each algorithm is structured with a series of steps that guide the user from start to finish. The algorithms are designed to be simple and educational, suitable for beginners in programming.

Uploaded by

dishagangamma17
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

Algorithm -01

Step1: Start
Step 2: Read a,b
Step 3: Display before swap a,b
Step 4: temp=a
a=b
b=temp
Step 5: Display after swap a,b
Step 6: Stop

Algorithm -02
Step 1: Start
Step 2: Read a,b
Step 3: S=a+b
D=a-b
P=a*b
Q1=a/b
Q2=a//b
R=a%b
Step 4: Display S,D,P,Q1,Q2,R
Step 5: Stop.
Algorithm -03
Step 1: Start
Step 2: Read l,b
Step 3: Area=l*b
Perimeter=2*(l+b)
Step 4: Display Area , Perimeter
Step5: Stop

Algorithm -04
Step 1: Start
Step 2: Read p ,t ,r
Step 3:SI=(p*t*r)/100
Ap=p+SI
Step 4: Display SI,AP
Step5: Stop

Algorithm -05
Step 1: Start
Step 2: Read a,b,c
Step 3:Big=a
If b>Big?
Big=b
If c>big?
Big=c
Step 4: Display big
Step5: Stop
Algorithm -06
Step 1: Start
Step 2: Read name,age
Step 3: if age>18?
Display name is eligible to apply for DL
Else
Display name is not eligible to apply for DL
Step 4: Stop

Algorithm -07
Step 1: Start
Step 2: Read per
Step 3: If per>=90:
Display grade A
Elif per>=81:
Display grade B
Elif per>=71:
Display grade C
Elif per>=61:
Display grade D
Else
Display grade E
Step 4: Stop
Algorithm -08
Step 1: Start
Step 2: Initialize Small=Large=0
Step 3: for a=0 to 5
Read x
If a==0
Small=Large=x
If x<Small
Small=x
If x>Large
Large=x
Step 4: Display Small,Large
Step5: Stop

Algorithm -09
Step 1: Start
Step 2: Read num
Step 3: for count=1 to 10
Prd=num*count
Display prd
Step 4: Stop
Algorithm -10
Step 1: Start
Step 2: Read Num, initialize Sum=0
Step 3: while Num!=0
R=Num%10
Sum=Sum+r
Num=Num//10
Step 4: Display Sum
Step5: Stop

Algorithm -11
Step 1: Start
Step 2: Read Num, initialize Rev=0
Step 3: original=Num
Step 4: while Num>0
Dig =Num%10
Rev =Rev*10+dig
Num=Num//10
Step 5: if original==Rev
Display the given number is palindrome
Else
Display the given number is not palindrome
Step 6: Stop
Algorithm -12
Step 1: Start
Step 2: Initialize row=5
Step 3: for i= rows down to 1
for j=1 to rows
Display j
Step 4: Stop

You might also like