Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication3.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include <math.h>
- // an example of a prime number is a number that is only divisible by its self and 1
- using namespace std;
- float inputvariable;
- float radius;
- float pi;
- float circle;
- float square;
- float inputsquare;
- float difference;
- float roundupvariable;
- float rounddownvariable;
- int main()
- {
- cout << "Please Enter Variable in CM" << endl;
- cin >> inputvariable;
- pi = 3.14159;
- inputsquare = inputvariable * inputvariable;
- square = inputsquare / 100;
- cout << "The area of your square is: " << square << " Meters" << endl;
- circle = pi * inputsquare;
- circle = circle / 100;
- cout << "The area of your circle is: " << circle << " Meters" << endl;
- difference = circle - square;
- cout << "The difference of the two shapes is: " << difference << " Meters" << endl;
- roundupvariable = ceil(inputvariable);
- roundupvariable = roundupvariable * roundupvariable * roundupvariable;
- rounddownvariable = floor(inputvariable);
- rounddownvariable = rounddownvariable * rounddownvariable * rounddownvariable;
- cout << " A Cube with your variable rounded up is " << roundupvariable << " Meters" << endl;
- cout << " A Cube with your variable rounded down is " << rounddownvariable << " Meters" << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment