← Back to Question List
C++ Code Walkthrough #15
Simple Function Return
📄 Code
Read carefully — what does this print?1#include <iostream>2using namespace std;34int doubleIt(int n) {5 return n * 2;6}78int main() {9 int a = 3;10 int b = doubleIt(a);11 int c = doubleIt(b) + 1;12 cout << a << " " << b << " " << c << endl;13 return 0;14}