Question: C++ small Questions Q1: For an integer variable num, which has been declared and initialized, determine if it is a multiple of 6. If yes,

C++ small Questions

Q1: For an integer variable num, which has been declared and initialized, determine if it is a multiple of 6. If yes, assign true to bool variable isMultiple(already declared), otherwise, assign false to isMultiple. The answer is one single statement.

Q2: Complete the following program that reads three integers, and finds the smallest value of the three integers. [Hint: use a variable to keep track of the smallest number from num1, num2 to num3.]

#include using namespace std; int main() { int num1, num2, num3; cin >> num1; cin >> num2; cin >> num3; // your code starts here

// your code ends here cout << min << endl; }

Q3: Given a double variable temperature, which has been declared and initialized. Print "hot"(no newline after) if the temperature is higher than 90. To test, enter a sequence of numbers terminated by 0. Code segment only, no complete program!

Q4: Given a double variable temperature which has been declared and initialized, print(no newline character after) "hot" if the temperature is greater than 90, print "not hot" otherwise. You don't need to use if-else to solve this problem. To test, enter a sequence of numbers terminated by 0. Code segment only, no complete program!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!