CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Double to Int Truncation

C++ code walkthrough · Question 25
easyCasting

Code

Read carefully. What does this print?
1#include <iostream>
2using namespace std;
3int main() {
4 double d = 7.9;
5 int i = (int)d;
6 cout << i << endl;
7 return 0;
8}

Your answer