Check out example codes for "double to int c++". It will help you in understanding the concepts better.

Code Example 1

double x = 5.4;
int y = (int) x;

Learn ReactJs, React Native from akashmittal.com