0% found this document useful (0 votes)
190 views8 pages

Assignment: Flow Charts

The document contains 7 flow charts describing algorithms: 1) Read and calculate sum, product, and average of 3 numbers 2) Read 2 numbers and display larger and smaller 3) Read n and calculate sum of series 1+3+5+...n 4) Read values until -1 entered, count positive and negative 5) Read 25 numbers and calculate factorial product 6) Read and display values until negative entered 7) Read values until negative entered and display largest

Uploaded by

api-19653075
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
190 views8 pages

Assignment: Flow Charts

The document contains 7 flow charts describing algorithms: 1) Read and calculate sum, product, and average of 3 numbers 2) Read 2 numbers and display larger and smaller 3) Read n and calculate sum of series 1+3+5+...n 4) Read values until -1 entered, count positive and negative 5) Read 25 numbers and calculate factorial product 6) Read and display values until negative entered 7) Read values until negative entered and display largest

Uploaded by

api-19653075
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 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

You might also like