You are on page 1of 9

Sum of numbers between 1 and 10 1. 2. 3. 4. 5.

Initialize i as 1 and sum as 0 repeat step 3,4 until i <=10 sum=sum+i increment i by 1 end

Sum of even numbers between 1 and 10 Sum of odd numbers between 1 and 10

Factorial of a number 1. i 2. 3. 4. 5. 6. 7. Initialize fact as 1 repeat step 4,5 until i >=1 fact=fact*i decrement i by 1 print the value of fact end Take the number for which the

factorial has to be found and store it in

Fibonacci Series 1. Initialize the value of a as 0 and b as 1. 2. Take the limit n of the series 3. Print the value of a and b
4.

repeat steps 5 to 9 until n>2

5. c=a + b 6. print the value of c 7. a=b 8. b=c 9. decrement n by 1 10. end

Display the Prime numbers between 1 and 200


1.

Initialize value of k as 2.

2. Repeat steps 3 to 8 until k<=200 3. Initialize value of j as 2.


4. 5.

Repeat steps 5, 6 until j<k if k%j is zero, goto 8

6. increment j 7. if j is equal to k, print value of j 8. increment k 9. end

Reversing the digits of a number 1. Take the value of num from the user 2. Initialize rev_num as 0 3. Repeat until num > 0 4. rev_num = rev_num*10 + num%10; 5. num = num/10 6. Display the value of rev_num

Algorithm to find numbers divisible by 2,3 and 5

Algorithm to find all the numbers between 1 and 100 that ends with 1.

Decimal to binary conversion

You might also like