Question: write a program to practice using variables and arithmetic operator +, *, /, %. 1. Declare 4 integer variables num1, num2, num3, and num4 (must
write a program to practice using variables and arithmetic operator +, *, /, %.
1. Declare 4 integer variables num1, num2, num3, and num4 (must use these names) and assign them the initial values of 100, 10, 16, and 4, respectively.
2. Print those values on the screen using the variable names, one number in each line.
3. Calculate the following results with the 4 variables you just created.
(a) Get the sum of num1 and num2 and save the result to a new variable (give a good name to the new variable) and print the result using the new variable on the screen.
(b) Get the product of num1 times num3, save the result to another new variable, and print the result to the screen.
(c) Get the quotient of num2 divide by num4, save the result to a third new variable, and print the result to the screen.
(d) Get the remainder of num1 divide by num4, save the result to a fourth new variable, and print the result to the screen.
Declare all variables inside the main function and use the int data type.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
