Sunteți pe pagina 1din 10

Assignment no 2

NAME:ABID JAN

SECTION: CB

ROLL NO: 13221

COURSE TITLE: INTRO TO COMPUTER PROGRAMMING

COURSE ID: CS106 [04]

2. Draw the flow charts and Algorithms for each of the following
requirement.

flowchart: a+b Start

a, b & c

a+b=c

Print c

Stop
N
Algorithm:
e
a+b
x
t

Sum of a b = c
Read input a
Read input b
c=a+b
Display c
Stop
N
e
x
t
Algorithm :(a+b)**2

Square root of a b = c
Read input a
Read input b
c=a**2 +b**2
Display c
Stop
N
e
x
t
flowchart: (a+b)**2 Start

a, b & c

a**2+b**2=c

Print c

Stop
N
e
x
t
Algorithm: Average of five user desire numbers.

Input five numbers


For number 1 to 5
Read numbers
Add the numbers
Any more number
If yes go to step 2
No AVG=SUM/5
Write AVG
STOP
N
e
x
t
Flowchart: Average of five user desire numbers.

Start

For number 1 to 5

Read
number 1 to
5

Add
numbers 1
to 5

Any more
number
Yes
No 1

1
AVG=SUM/
5

Write AVG

STOP

Algorithm:Co to Fahrenheit
Start
Read the value of Celsius
F=(1.8*Celsius)+32
Print F
Stop
N
e
Flowchart:Co to Fahrenheit
x
t

Start

Read the value of


celsius

F=(1.8*Celsius)+32

Print F

Stop
N
e
x
t

N
e
x
t
N
e
x
t

The End

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