Professional Documents
Culture Documents
Graded Lab 1
Graded Lab 1
1. Read a number from the user. Find the sum of numbers from 1 till the
given number.
Input
10
Output
The sum of numbers from 1 to 10 is: 55
Input
30
Output
The sum of numbers from 1 to 30 is: 465
2. Read a number from the user .Find the counts of multiples of 3 from 1
till the given number.
Input
10
Output
Count of multiples of 3 from 1 to 10 is 3
Page 1 of 2
Cairo University
Computer Engineering Department
Faculty of Engineering
Input
5
6
2
10
9
11
0
Output
Sum of even numbers is 18
4. Write a program to find the area of a trapezium. Read from the user
the length of base 1, base 2 and height as float numbers and print the
area using the given formula.
Area= 0.5 *(base 1 + base 2)* height
Input
3.5 9 5.5
Output
Area of trapezium is 34.375
Page 2 of 2