C++
C++ program to determine the value of “sqrt(16)” using predefined function in “cmath”:
C++ program to determine the value of “pow(2.0, 3.0)” using predefined function in “cmath”:
C++ program to determine the value of “pow(2, 3)” using predefined function in “cmath”:
C++ program to determine the value of “pow(2, 3)” using predefined function in “cmath”:
C++ program to determine the value of “pow(2.0, 3)” using predefined function in “cmath”:
C++ program to determine the value of “pow(1.1, 2)” using predefined function in “cmath”:
C++ program to determine the value of “abs(3)” using predefined function in “cmath”:
C++ program to determine the value of “abs(-3)” using predefined function in “cmath”:
C++ program to determine the value of “abs(0)” using predefined function in “cmath”:
C++ program to determine the value of “fabs(-3.0)” using predefined function in “cmath”:
C++ program to determine the value of “fabs(-3.5)” using predefined function in “cmath”:
C++ program to determine the value of “fabs(3.5)” using predefined function in “cmath”:
C++ program to determine the value of “ceil(5.1)” using predefined function in “cmath”:
C++ program to determine the value of “ceil(5.8)” using predefined function in “cmath”:
C++ program to determine the value of “floor(5.1)” using predefined function in “cmath”:
C++ program to determine the value of “floor(5.8)” using predefined function in “cmath”:
C++ program to determine the value of “pow(3.0, 2)/2.0” using predefined function in “cmath”:
C++ program to determine the value of “pow(3.0, 2)/2” using predefined function in “cmath”:
C++ program to determine the value of “7/abs(-2)” using predefined function in “cmath”:
C++ program to determine the value of “(7+sqrt(4.0))/3.0” using predefined function in “cmath”:
C++ program to determine the value of “sqrt(pow(3,2))” using predefined function in “cmath”:
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Problem Solving with C++ (10th Edition)
- It could perform the four basic arithmetic operations and could locate information stored in tabular form. Choices:arrow_forwardDetermine if the expression is true or false. A true expression is equivalent to one, a false expression is equivalent to zero. a) if (12%15 > 0) True False b) if ((5 <= 10) && (36/4 < 4)) True False c) if (strlen("hello") != 6) True Falsearrow_forwardCode____1.Print the numbers from 1 to n, but for multiples of 3, print "Fizz" instead of the number, and for multiples of 5, print "Buzz". For numbers which are multiples of both 3 and 5, print "FizzBuzz". QWRB.arrow_forward
- Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('{:.2f}'.format(your_value)) (1) Prompt the user to input a wall's height and width. Calculate and output the wall's area (integer). (Submit for 2 points). Enter wall height (feet): 12 Enter wall width (feet): 15 Wall area: 180 square feet (2) Extend to also calculate and output the amount of paint in gallons needed to paint the wall (floating point). Assume a gallon of paint covers 350 square feet. Store this value in a variable. Output the amount of paint needed using the %f conversion specifier. (Submit for 2 points, so 4 points total). Enter wall height (feet): 12 Enter wall width (feet): 15 Wall area: 180 square feet Paint needed: 0.51 gallons (3) Extend to also calculate and output the number of 1 gallon cans needed to paint the wall. Hint: Use a math function to round up to the nearest gallon. (Submit for 2 points, so 6 points total). Enter wall height (feet): 12…arrow_forwardThe volume and area of a cylinder are calculated as: Volume = πr2h Area = 2πrh + 2πr2 Given the radius and height of a cylinder as floating-point numbers, output the volume and area of the cylinder. Hint: Use the built-in pow() function and the constant pi from the math module in your calculations. Output each floating-point value with one digit after the decimal point, which can be achieved as follows:print('Volume: {:.1f} cubic inches'.format(yourValue)). Ex: If the input is: 5.2 8.1 where 5.2 is the radius of the cylinder and 8.1 is the height of the cylinder, then the output is: Volume: 688.1 cubic inches Surface area: 434.5 square inchesarrow_forwardARGUMENT TWO Valid ☐ Invalid ☐ Some X is Z Some Y is not Z ∴ Some Y is X ARGUMENT THREE Valid ☐ Invalid ☐ All C is G All C is L ∴ All L is G ARGUMENT FOUR Valid ☐ Invalid ☐ No Z is L All O is L ∴ No O is a Z ARGUMENT FIVE Valid ☐ ï Invalid ☐ No B is A Some R is not B ∴ Some R is not A ARGUMENT SIX Valid ☐ ï Invalid ☐ All F is M Some S is M ∴ Some S is Farrow_forward
- Evaluate the following arithmetic expressions 1. 5 / 2 + 4 - 2 * 7 % 3 2. 5.0 / 2 + 4 - 2 * 7 % 3 3. 17 - 5 * 4 / 10 * 5 / 2arrow_forwardEvaluate the following expressions. 4 + 7 / 2 <= 9 - 15 % 6arrow_forwardPython Programming Give the smallest expression, containing only the number 3 and the operator / and parentheses whose value is 9.0.arrow_forward
- Declare five variables a, b, c, d, e, and f. Assign a a number literal between 5 and 15 and assign b a different number literal between 5 and 15. Assign c the String literal value "Adam" and assign d the String literal value "Bob". Assign e the boolean literal true and f the boolean literal false. Report the results of performing the following calculations: a + b a + c a + e a + f c + d c + e c + f e + f a / b a % b a / c a / e a / f a > b a < b c > d c < d a > c a < c b < f b > f e == 1 f == 0 e == "" f == ""arrow_forwardEvaluate the following expressions. (2) a. 4 * 7 == 74 / 3 b. 4 + 7 / 2 <= 9 - 15 % 6 c. 'K' < 'k' d. '+' <= '-' e. '5' <= '6' f. 3.9 / 4 - 6 >= 8 - 6.2 * 1.5arrow_forwardGiven two numbers that represent the lengths of a right triangle's legs (sides adjacent to the right angle), output the length of the third side (i.e. hypotenuse) with two digits after the decimal point. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Hypotenuse: {:.2f}'.format(c)) Ex: If the input is: 3.0 4.0 the output is: Hypotenuse: 5.00arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education