C++ program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer
###### Posted by Samath
Last Updated: April 06, 2022

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

Code:

```#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
double num;

cout << "Please enter a decimal number: ";
cin >> num;

cout << "Result: ";
cout << setprecision(0) << num << endl;

return 0;
}
```
###### C++ program that prompts the user to input five decimal numbers, prints the five decimal numbers, converts each decimal number to the nearest integer, adds the five integers and prints the sum and average of the five integers.
Samath | Apr 06, 2022
###### Decimal to Binary in C++
Samath | Dec 26, 2014
###### SQL Display two digits after decimal point
SceDev | Feb 08, 2024
###### Python Convert Decimal to Binary or Binary to Decimal
Samath | Jan 09, 2017
###### Python program that test if integer values can form a triangle
Samath | Nov 06, 2014
###### Java program that reads an integer and prints how many digits the number has
Samath | Feb 11, 2021
###### Convert Roman numerals to decimal using Java
Samath | Jan 17, 2024
###### Converting Time To Decimal using C++
Samath | Jan 04, 2017
###### C++ Convert from Decimal to Octal
Samath | Jan 05, 2017
###### Binary to Decimal Conversion in C#
Samath | Jan 10, 2021
###### Python to Convert Decimal to Binary, Octal and Hexadecimal
gideonna | Apr 13, 2016
###### C++ Summing the digits in an integer
Samath | Jan 06, 2021
###### Recursive function that find the sum of digits in a integer using C++
Samath | Dec 24, 2014
###### Summing the Digits in an Integer using Python
Samath | Mar 02, 2015