I have to make this table for my class:
Enter num1:
Enter num2(must be greater than 16):
output:
num1 num2 num3 sum1 sum2 prod1 prod2 quot1 quot2 rmd
2 20 20 22 22 40 40 0 0.1 2
6 16 16 22 22 96 96 0 0.375 6
^ (this num gets multiplied by 3 everytime) and going on for 3 more lines
Is this going to be very long to write? Do I have to define a variable for each line? I am EXTREMELY new to this, please help.
BTW i am not asking for answers
This is what i have so far:
Code:#include <iostream> #include <string> using namespace std; int main() { //DEFINITIONS cout << "Please enter the first number: "; int num1; cin >> num1; cout << "Please enter the second number (greater than 16): "; int num2; cin >> num2; float num3; num3 = (float)num2; float sum1; sum1 = num1 + num2; float sum2; sum2 = num1 + num3; float prod1; prod1 = num1 * num2; float prod2; prod2 = num1 * num3; float quot1; quot1 = num1 / num2; float quot2; quot2 = num1 / num3; float rmd; rmd = num1 % num2; // TABLE cout << "Num1 Num2 Num3 Sum1 Sum2 Prod1 Prod2 Quot1 Quot2 Rmd "; return 0; }



LinkBack URL
About LinkBacks
.



