Easy Tutorial
❮ Cpp Examples Vowel Consonant Cpp Passing Arrays To Functions ❯

C++ Example - Standard Input and Output

C++ Examples

Using C++ to get user input and output to the screen:

Example

#include <iostream>
using namespace std;

int main()
{    
    int number;

    cout << "Enter an integer: ";
    cin >> number;

    cout << "The number entered is: " << number;    
    return 0;
}

The above program execution output is:

Enter an integer: 12
The number entered is: 12

C++ Examples

❮ Cpp Examples Vowel Consonant Cpp Passing Arrays To Functions ❯