C++ Output (Print Text)

 C++ Output (Print Text)

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:


#include <iostream> 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!");

or

puts("Hello, World!");

Post a Comment

Post a Comment (0)

Previous Post Next Post