Professional Documents
Culture Documents
Lab 3 Exercises
Lab 3 Exercises
Exercise 2
Exercise 3
3.1:
3.2:
b/(a-c) 3 5 2.5 10
Exercise 4
4.1:
#include <iostream>
int main() {
const double PI = 3.14;
float radius;
cout << "Area of the circle: " << area << endl;
cout << "Circumference of the circle: " << circumference << endl;
return 0;
}
#include <iostream>
int main() {
int length, width, area, perimeter;
cout << "The area of the rectangle is: " << area << endl;
cout << "The perimeter of the rectangle is: " << perimeter << endl;
return 0;
}
#include <iostream>
int main() {
int total_seconds;
cout << hours << " hours, " << minutes << " minutes and " << seconds << " seconds" << endl;
return 0;
}