Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a program to read a decimal number (d) and an integer number (n) to round d to n digits after decimal point. If the

write a program to read a decimal number (d) and an integer number (n) to round d to n digits after decimal point. If the number of digits after decimal point are < n, then add more zeros to make it exactly n digits after the decimal point NOTE your function must act like the setprecision and showpoint functions in C++.

Sample I/O

Enter a decimal number followed by an integer number: 4.23675 3

Your number after being round to 3 digits is 4.238

CONTINUE(y/n)? y

Enter a decimal number followed by an integer number: 9.46 4

Your number after being round to 3 digits is 9.4600

CONTINUE(y/n)? n

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

Students also viewed these Databases questions

Question

What is the environment we are trying to create?

Answered: 1 week ago

Question

How can we visually describe our goals?

Answered: 1 week ago