Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************Circle Challange*******************/
- #include <iostream>
- #include <math.h>
- #include <stdio.h>
- using namespace std;
- int main()
- {
- cout << "Circle Calculator" << endl;
- double radius;
- double diameter,area,circumference;
- double Pi = 3.14;
- cout << "Enter Radius: "; // Type a Radius and press enter
- cin >> radius;
- diameter = 2 * radius;
- cout << "\nDiameter: "<< diameter;
- circumference = diameter * Pi;
- cout << "\nCircumference: "<< circumference;
- area = Pi * pow(radius,2.0);
- cout << "\nArea: "<< area;
- cout << "\n\nBye!";
- return 0;
- }
- /************************Cubic Challange*******************/
- #include <iostream>
- #include <math.h>
- #include <stdio.h>
- using namespace std;
- int main()
- {
- cout << "Cubic Calculator:" << endl;
- double length;
- double volume,area,circumference;
- cout << "\n\nEnter the side length of the cubic: "; // Type a Radius and press enter
- cin >> length;
- circumference = 12 * length;
- cout << "\nCircumference: "<< circumference;
- area = 6 * pow (length, 2.0);
- cout << "\nArea: "<< area;
- volume = pow (length, 3.0);
- cout << "\nVolume: "<< volume;
- cout << "\n\n\nSee you later!";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement