Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago

Question

Have roles been defined and assigned?

Answered: 1 week ago