#includeusing namespace std; int main() { int num; cout << "Enter a number: "; cin >> num; cout << "You entered: " << num << endl; return 0; }
#includeIn these examples, we are using the std istream read function to read input. The package library used for this is the I/O stream library in C++.#include using namespace std; int main() { ifstream inputFile("input.txt"); string line; while (getline(inputFile, line)) { cout << line << endl; } inputFile.close(); return 0; }