Server IP : 172.16.15.8 / Your IP : 18.221.183.34 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/klwhite1/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// File Name: hw3.cpp // Author: Kristy White // Instructor: Dr. John Wang // Due Date: Sept. 26, 2007 // Compiling: g++ hw3.cpp -o hw3.out // Execution: ./hw3.out // // Goal: This program will involve operations and its outputs. #include <iostream> #include <iomanip> using namespace std; int main() { // 1. var. decl. float a, b, add, sub, mult, div; cout << fixed << showpoint << setprecision(1); // input cout << "Input the first number: (-1 to quit): "; cin >> a; while( a > 0) { cout << "Input the second number: "; cin >> b; // computing add = a + b; sub = a - b; mult = a * b; div = a / b; // out cout << "The sum of the two numbers is: " << add << '\n'; cout << "The difference of the two numbers is: " << sub << '\n'; cout << "The multiplication of the two numbers is: " << mult << '\n'; cout << "The division of the two numbers is: " << div << endl; cout << "Input the first number: (-1 to quit): "; cin >> a; } return 0; }