Ex: If the input is: the output is: Note: In C++, integer division discards fractions. Ex: 6 / 4 is 1 (the 0.5 is discar

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Ex: If the input is: the output is: Note: In C++, integer division discards fractions. Ex: 6 / 4 is 1 (the 0.5 is discar

Post by answerhappygod »

Ex: If the input is:
the output is:
Note: In C++, integer division discards fractions. Ex: 6 / 4 is 1 (the 0.5 is discarded). C++ please and thanks
(2) Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolute value of y, and the square root of (xy to the power of z). C++ please and thank you
Ex: If the input is:
the output is:
172.466 1.29951e+279 6.5 262.43
(3) Given a long long integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800) 555-1212.
Ex: If the input is:
the output is:
Hint: Use % to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which is 72.
Hint: Use / to shift right by the desired amount. Ex: Shifting 572 right by 2 digits is done by 572 / 100, which yields 5. (Recall integer division discards the fraction).
For simplicity, assume any part starts with a non-zero digit. So 0119998888 is not allowed. C++ please and thanks
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply