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

Find the value of x in each of the following a) Ž-2 = 6 b) § + 1 = 5
What is the slope of the line that passes through the points (-3,3)and (-3,13)
What word will fit. I'm determined.i try to change the (blank) to the possible
So I’m kinda stuck.. I only need help on the bottom one S=( )( )+2( )=
The graph highlights two other points on the trend line. Use them to find another equation for the trend line shown for this scatter point. A) Y=82x+998 B) Y=24
look at the images please I WILL MRK THE BRIANLEST
Question 31: Please help what is the cosine ratio of ∠X in the given triangle?
What are the names of the 3 main languages used for making websites
Name one of the new products formed when acids and alkalis mix?
8x/3 - 2x/4 =-13 how do you solve