Professional Documents
Culture Documents
Tasks OOP Lab 02
Tasks OOP Lab 02
Tasks OOP Lab 02
/*
You can include comments that can
occupy several lines.
*/
Special Symbols
+ - * /
. ; ? ,
<= != == >=
Reserved Words (Keywords)
int, float, double, char, const, void, return
Simple Data Types
Triangle Circle
Area = ½ × b × h Area = π × r2
b = base Circumference = 2 × π × r
h = vertical height r = radius
Square Rectangle
Area = a2 Area = w × h
a = length of side w = width
h = height
Parallelogram
Area = b × h
b = base
h = vertical height
Lab Task 3: Write a program in which user put any value on output
window, and program give the counting up to that number using
do…while loop.
Lab Task 5: Write a program that creates the following pattern using
Nested for:
*
**
***
****
*****
Lab Task 6: Write a program that creates the following pattern using
Nested for: