#include <iostream> using namespace std; int main() { float f = 3.5; int a = f; // this is how you do in C int b = static_cast<int>(f); cout << b; }