Thursday, October 10, 2013

ALGORITHM TO FIND SUM OF THE SERIES 1*5 - 2*7 + 3*9 - 4*11 ... UPTO N TERMS


STEP 1.      I <-- 1, J=5, Sum <-- 0, N <-- 0, Sign=1
STEP 2.      Read N
STEP 3.      While (I <= N)
        Begin
             Sum <-- Sum+  Sign*(I * J)
         J <-- J + 2
      I <-- I + 1
      Sign= Sign * (-1)
             End
STEP 4.      Print Sum

ALGORITHM TO FIND SUM OF THE SERIES 2+5+8+11...UPTO N TERMS


STEP 1.      I <-- 0, J=2, Sum <-- 0, N <-- 0
STEP 2.      Read N
STEP 3.      While (I <= N-1)
        Begin
             Sum <-- Sum+ J
         J <-- J + 3
      I <-- I + 1
             End
STEP 4.      Print Sum

Algorithm to find largest of three Numbers


Algorithm to find largest of three Numbers


Flowchart to print sum of Series with alternate manner of plus and minus sign


Flowchart to print sum of Series.

Flowchart to find Factorial of a number


Flowchart to print all the integers between 1 and N which are evenly divisible by 6 and 7


Algorithm to print all the integers between 1 and N which are evenly divisible by 6 and 7

STEP 1.      I <-- 1, N <-- 0
STEP 2.      Read N
STEP 3.      While (I <= N) do Steps 4 and 5
STEP 4.      Is (I mod 6 = 0 AND I mod 7 = 0) Then
Begin
Print I
End
STEP 5.      I <-- I + 1

FLOWCHART TO FIND SUM OF THE SERIES 1+3+5+7+….UPTO N TERMS


ALGORITHM TO FIND SUM OF THE SERIES 1+3+5+7+….UPTO N TERMS


STEP 1.       I <-- 0, J<--1, Sum <-- 0, N <-- 0
STEP 2.       Read N
STEP 3.       While (I <= N-1)
        Begin
             Sum <-- Sum+ J
         J <-- J + 2
      I <-- I + 1
             End
STEP 4.       Print Sum