Sunteți pe pagina 1din 8

1

ASSIGNMENT
FLOW CHARTS

Draw flow charts for each of the following.

1. Read 3 numbers. Determine and display the sum, product and


average of 3 numbers.

2. Read 2 numbers. Determine and display the larger and smaller


value amongst the 2 values entered by the user.

3. Determine and display the sum of the following series:


1+3+5+7…………………n where n is entered by the user.

4. Read values till -1 is not entered by the user. Determine and


display the total number of positive and the total number of negative
values entered by the user.

5. Determine and display the factorial of 25 numbers entered by


the user.

6. Read in values and display them as long as the user does not
enter a negative value.

7. Read values till a negative value is not entered by the user.


Determine and display the largest value entered by the user.

Assignment No 1
Flow Charts
2

1. Read 3 numbers. Determine and display the sum, product and


average of 3 numbers.

START

Read a,b,c

Sum=a+b+c
Prod=a*b*c
Avg=Sum/3

Display
Sum,Prod,Avg

STOP

Assignment No 1
Flow Charts
3

2. Read 2 numbers. Determine and display the larger and smaller


value amongst the 2 values entered by the user.

START

Read a,b

a> F Print”greater” ,b
b “Smaller No” a

Print”greater” ,a
“Smaller No” ,b

STOP

Assignment No 1
Flow Charts
4

3. Determine and display the sum of the following series:


1+3+5+7…………………n where n is entered by the user.

START

Read n

i=1,Sum=0

F
i<=
Print Sum STOP
n
T

Sum=Sum+i

i=i + 2

Assignment No 1
Flow Charts
5

4. Read values till -1 is not entered by the user. Determine and


display the total number of positive and the total number of negative
values entered by the user.

START

Pos=0,Neg=0

READ n

n F Print
=1 Pos,Neg STOP

n F
>0

Pos=Pos + 1 Neg=Neg + 1

Read n

Assignment No 1
Flow Charts
6

5. Determine and display the factorial of 25 numbers entered by


the user.

START

i=1

F
i Print Prod STOP
<=25

Read N

Prod=1, j = 1

F
j=j+1 j
<=n

Prod=Prod * j

j=j+1
Assignment No 1
Flow Charts
7

6. Read in values and display them as long as the user does not
enter a negative value.

START

Read n

n F
STOP
>0

Print n

Read n

Assignment No 1
Flow Charts
8

7. Read values till a negative value is not entered by the user.


Determine and display the largest value entered by the user.

START

Read N

Great=N

N F
Print Great STOP
>0

F
Great
<n

Great =N

Read n

Assignment No 1
Flow Charts

S-ar putea să vă placă și