Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 13

By computers

Algorithm
An algorithm is the sequence of steps taken to solve a problem
Steps and their sequence of execution is important

Before starting to write a computer program, design the solution/algorithm


Using pseudo code Using flow chart

Algorithm to calculate average of two numbers given by user Take input in a Take input in b average = (a+b)/2 Output average

1. 2. 3. 4.

start

Algorithm to calculate average of two numbers given by user

Input a

Input b

Avg = (a+b)/2

Print Avg

Stop

wiley.com

Area of a circle Add two numbers given by user as input Tell maximum of two numbers given by user

Compile
Go to command prompt
The black window
Dos shell

gcc test1.c o test1

Execute
test1

Research and Find out Solution about below real life issues
Carbon Footprints Calculator BMI Gender Neutrality

Write pseudo code and Draw flow chart for below problems
You have two jugs 1 has a 5 liters capacity and the other has 3 liters . They both have irregular shapes that means you cannot tell by simply looking how full the jugs are unless you fully fill them up with water. How would you obtain 4 liters of water using the two jugs? (Two ways) You have 8 pool balls. The problem is, one of them is heavier than the rest. You have two attempts to find the heavier ball using a weight balance. Now show me how to do it!

You might also like