Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ round to whole number

#include <iostream>
#include <cmath>
using namespace std;

int main() {

  // display integral value closest to 15.5
  cout << round(15.5);

  return 0;
}

// Output: 16
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #number
ADD COMMENT
Topic
Name
6+1 =