jonnika27 jonnika27
  • 23-02-2020
  • Computers and Technology
contestada

Write a program that prompts the user to input the decimal value of a double and outputs the number rounded to the nearest integer.

Respuesta :

beingteenowfmao
beingteenowfmao beingteenowfmao
  • 24-02-2020

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

double n;

cout<<"Enter a decimal number: ";

cin>>n;

int Round= floor((n- floor(n))*2);

if(Round==0)

{

n= floor(n);

}

else n= ceil(n);

cout<<n;

return 0;

}

Ver imagen beingteenowfmao
Answer Link

Otras preguntas

In the early sixteenth century, the __ of the catholic church caused a rebellion now known as the ___. 1st Blank has Support & Sympathy, Weakness & Decl
Brendon is walking home from a place that is 1.5 miles away. The function y = 7,920 − 270x represents Brendon’s distance in feet from home, y, in relation to th
what are the volume of cerebrospinal fluid​
WHY IS PAKISTAN UNDER GENERAL MUSHARAFF IS NOT A DEMOCRACY
ASAP!! Please help me. I will not accept nonsense answers, but will mark as BRAINLIEST if you answer is correctly with solutions.
Photographs can provide information. What do you learn from the photo of this sculpture? Please help I need to graduate!!!
Adolescents who use aggression deliberately, known as ________, are much more popular than adolescents who use aggression without planning to, known as ________
25x^2+58+16 how do you factor
In what ways can wordplay be most helpful in improving a narrative? Select two options. a. It can help maintain objectivity within a text. b. It can help show a
Solve for the value of x ​ 3x + 8 = 2