Question: Using C++. Short Answer Questions: Given two floating point variables x and y. Write a single input statement to read the values of both x
Using C++.
- Short Answer Questions:
- Given two floating point variables x and y. Write a single input statement to read the values of both x and y (must put a prompt before the input statement)
- Write a selection statement that will check the state of water depending on its temperature. If the temperature is greater than or equal to 212, display vapor state, otherwise check if it is less than 212, but greater than 32, then display liquid, and if less than or equal to 32, then display solid
- Given a string variable str1, and assume its value is defined. Write proper C++ statements to display the length of the string str1 and also display a substring that starts from second character and has total 4 characters.
- Write a for loop that can be used to first ten odd numbers.
- Factorial of an integer number n can be approximated using the following formula
factorial = , where e = exp(1)
Write this expression properly in C++ (not the entire program).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
