TUTORIAL SHEET N°1 (ALGORITHMS AND FLOWCHARTS)
1. Write an algorithm to enter length in centimeter and convert it into meter and
kilometer.
2. Write an algorithm to convert days into years, months and days. (Let’s assume
that each year contains 365 days, and each day 30 days)
3. Write an algorithm to convert seconds into hours, minutes and seconds.
4. Write an algorithm to enter marks of five subjects and calculate total, average
and percentage.
5. Write an algorithm to find power of any number x^y.
6. Write an algorithm to check whether a number is positive, negative or zero.
7. Write an algorithm to input marks of five subjects Physics, Chemistry, Biology,
Mathematics and Computer. Calculate percentage and grade according to
following:
Percentage >= 90%: Grade A
Percentage >= 80%: Grade B
Percentage >= 70%: Grade C
Percentage >= 60%: Grade D
Percentage >= 40%: Grade E
Percentage < 40%: Grade F
8. Write an algorithm to calculate and display the sum of all even numbers
between 1 and 99.
9. Write an algorithm to calculate and display the sum of all odd numbers between
0 and n.
10. Write an algorithm to swap values of two variables.
11. Write an algorithm to calculate and display the value of .
12. Write an algorithm to calculate factorial of n.
Note: for each exercise, draw the corresponding flowchart.
Page 1 on 1