Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Short Questions: Given two floating point variables x and y. Write a single input statement to read the values of both x and y (must
- Short 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 = 2nnen, 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started