CJCoding With Joseph
← Back to Question List
C++ Code Walkthrough #25

Double to Int Truncation

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