Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

C++ Example - Output "Hello, World!"

C++ Example - Output "Hello, World!"

C++ Example C++ Example

Use C++ to output the string "Hello, World!" — a simple introductory example that requires the main() function and standard output. cout:

Example

include

<

iostream

using

namespace

std

;

int

main

(

)

{

cout

<<

"

Hello, World!

"

;

return

0

;

}

The output of the above program is:



Hello, World!

C++ Example C++ Example