type-name (expression) //c++ notation
#include <iostream>
main()
{
double a = 99.09399;
float b = 97.20;
int c ;
c = (int) a;
cout << "Line 1 - Value of (int)a is :" << c << endl ;
c = (int) b;
cout << "Line 2 - Value of (int)b is :" << c << endl ;
return 0;
}
Output:
Line 1 - Value of (int)a is :99
Line 2 - Value of (int)b is :97
Ask Question