Simple Programs
Simple Programs
Pseudocode Practice
(Simple programs)
Write an algorithm using pseudocode in which
1. Print your name on the screen.
2. Print PAKISTAN ZINDABAD on screen.
3. Input two numbers and display their sum.
4. Input three numbers and find their average.
5. Input length and width of a rectangle and display its area.
6. Take user's age in years and display in months and days.
7. Take time in hours and display in minutes and seconds.
8. Get a number and display its square, cube and square root.
9. Input population and area of a country. Calculate and output
population density. (P.D= P/A)
10. Input radius of a circle and display its area. (Area = r2 )
11.A school wants to monitor the number of hours spent by a student
on the Internet. Using pseudocode, write an algorithm which will
i. record the times logged on and logged off.
ii. calculate the length of time student spends online.
iii. output the length of time.
12. Input meter no, current reading and previous reading. Calculate
units consumed and display the amount of bill.
amount of bill= unit consumed x 0.5
13.Input distance covered and time taken by a car. Calculate and Output
speed of a car. (S=D/T)
14. Input length, width and height of a cuboid. Calculate and output
volume of cuboid. (V= LxWxH)
15. Input base and perpendicular of a triangle. Calculate and output area
of triangle. (a= 1/2x bxh)
16. Input student’s marks in five subjects.(Marks in each subject is out of
100) . Calculate and output total and percentage of the student.
17. Input weight and height of a student. Calculate and output his/her
BMI (Body Mass Index).