#includeint main() { int x; std::cout << "Enter a number: "; std::cin >> x; std::cout << "You entered: " << x << std::endl; return 0; }
#includeThis example reads data from a file using the `std::ifstream` object. It reads each line of the file and outputs it to the console. Package Library: Standard C++ Library (included in C++ standard)#include int main() { std::ifstream inputFile("input.txt"); std::string line; while (std::getline(inputFile, line)) { std::cout << line << std::endl; } inputFile.close(); return 0; }