C++ Output (Print Text)
In C++, the most common way to output text (also known as "printing" text) to the console is by using the std::cout object and the "insertion operator" <<. For example, following code will output the text "Hello, World!" to the console:
int main() { std::cout << "Hello, World!" << std::endl; return 0; }
'std::endl' is used to insert a newline at the end of the output.
Alternatively, you can use 'printf()' or 'puts()' function to print the text.
printf("Hello, World!");
orputs("Hello, World!");
Post a Comment