Computer scienceProgramming languagesC++Types and data structures

Data types

Variable in code

Report a typo

Below is a piece of code, you should indicate on which line the variable is declared:

#include <iostream>
using namespace std;

int main(){ 
    int age;
    cout << "Enter your age: ";
    cin >> age;
    cout << "Your age = " << age << endl;

    return 0;
}

Note that an empty line is also considered a valid code line.

Enter a number
___

Create a free account to access the full topic