03 İNŞ246 IntroComProg
03 İNŞ246 IntroComProg
Input / output Used for any Input / Output (I/O) operation. Indicates that the
computer is to obtain data or output results
16/03/2023
Problem1
Find the area of a circle of radius r
Flowchart Algorithm
16/03/2023
Problem 2
Convert temperature Fahrenheit (F) to Celsius (C)
Inputs to the algorithm : Temperature in Fahrenheit, F
Expected output : Temperature in Celsius, C
Flowchart Algorithm:
start Step 1: Start
16/03/2023
Problem 3
Flowchart for an algorithm which gets two numbers and prints
sum of their value
Inputs to the algorithm : First A and Second B.
Expected output : C of the two numbers
Flowchart Algorithm:
start Step 1: Start
C= A + B Step 4: C A + B
Step 6: End
end
16/03/2023
Problem 4
Algorithm for find the greater number between two numbers.
start Algorithm:
Step 1: Start
Read A, B
Step 2: Read/input A and B
true false
If A > B Step 3: If A greater than B then C=A
Step 4: If B greater than A then C=B
Print A Print B
Step 5: Print C
end
? Step 6: End
16/03/2023
Problem 4
Algorithm for find the greater number between two numbers.
Flowchart Algorithm:
Step 1: Start
start
Step 2: Read/input A and B
Read A, B
16/03/2023
Problem 4
Algorithm for find the greater number between two numbers.
Flowchart Algorithm:
16/03/2023
Problem 5
Flowchart for an algorithm to calculate even numbers between 0 and 99
Flowchart Algorithm:
16/03/2023
Problem 6
start
Flowchart for the
calculate the average Sum0, C0
from 25 exam scores
which supplied user’s
Enter Exam
Scores, S
entrance.
Sum=Sum + S
C=C+1
yes
If C<=25
no
Av = Sum / 25
Write Av
end
16/03/2023
Problem 7:
Develop an algorithm that prints on the screen whether an integer
number entered from the keyboard is odd or even, and draw the flow
chart.
Algorithm: start
1. Start
2. Read A Read A
3. B = floor(A/2)*2
4. If A=B then print ”Even” else print “Odd” B = floor(A/2)*2
5. End
true false
If A = B
end
16/03/2023
Example:
Flowchart for the problem of printing odd numbers less than a given
number. It should also calculate their sum and count.
W
16/03/2023 4
Practice-2