Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can you answer fast ? pleaseeee Assignment Dear All Write a C program which rounds a given real number to a whole integer according to
can you answer fast ? pleaseeee
Assignment Dear All Write a C program which rounds a given real number to a whole integer according to the given rule. The program takes three numbers from the user, n1, n2 and n3.n1 represents decimal part, n2 represents floating point part of the number. n3 represents the number of zeros when it is rounded on the decimal part. Do not use type casting. Rounding RULE: A digit is larger than or equal to 5, the previous digit becomes incremented. If a digit is less than 5, the previous digit remains the same. e.g. 3456 278 2 (so the number is 3456.278 and n1=3456, n2=278, n3=2) Output is 3500 Input: 1442 3652 Output: 1400 Input: 1444 4472 Output: 1500Step 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