- #1
soul5
- 64
- 0
Like for example
Prompting message reads.
"Please enter a positive value"
Example:
Please enter a positive value: 234.7
Rounded to the nearest integer the number is: 235
Please enter a positive value: 10.3
Rounded to the nearest integer the number is: 10
What I have
int num;
cout<< "Please enter a positive value";
cin>> num;
cout<< num << endl;
The problem is that doesn't round the number to the nearest interger so what would I do to round it?
Prompting message reads.
"Please enter a positive value"
Example:
Please enter a positive value: 234.7
Rounded to the nearest integer the number is: 235
Please enter a positive value: 10.3
Rounded to the nearest integer the number is: 10
What I have
int num;
cout<< "Please enter a positive value";
cin>> num;
cout<< num << endl;
The problem is that doesn't round the number to the nearest interger so what would I do to round it?