Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- //2.16
- int x {0};
- int y{0};
- int sum {0};
- int product {0};
- int difference {0};
- int quotient {0};
- cout << " Enter your two integer: " ;
- cin >> x >> y;
- cout << "The sum is: " << x + y << endl;
- cout << "The product is:" << x * y << endl;
- cout << "The difference is: " << x - y << endl;
- cout << "The quotient is: " << x % y << endl;
- //2.20
- double r{0.0};
- double x{3.14159};
- cout << "Enter your radius: ";
- cin >> r;
- cout << "The circle's diameter is: " << 2 * r << endl;
- cout << "The circumference is: " << 2 * x * r << endl;
- cout << "The area is: " << x * r * r << endl;
- //2.28
- int number;
- cout << "Enter a five-digit number: ";
- cin >> number;
- cout << number / 10000 << " ";
- number = number % 10000;
- cout << number / 1000 << " ";
- number = number % 1000;
- cout << number / 100 << " ";
- number = number % 100;
- cout << number / 10 << " ";
- number = number % 10;
- cout << number << endl;
- //2.30
- int weight;
- int height;
- int BMI;
- cout << "Enter your weight in pounds: ";
- cin >> weight;
- cout << "Enter your height in inches: ";
- cin >> height;
- BMI = (weight *703) / (height * height);
- cout << "Your BMI values is: " << BMI << endl;
- cout << "\nBMI VALUES" << endl;
- cout << "Underweight: less than 18.5\n";
- cout << "Normal: between 18.5 and 24.9\n";
- cout << "Overweight: between 25 and 29.9\n";
- cout << "Obese: 30 or greater\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement