“Hello, World!” in C++
hello-v2.cpp
Download file: Windows | macOS | Unix
1// Program : "Hello, World!" in C++ with Modules
2// Author : Prof. Krofchok
3// Date : Fall 2025
4// Description: This program displays a greeting to the user.
5
6#include <iostream> // provides std::cout, std::endl
7
8void hello();
9
10int main()
11{
12 hello();
13}
14
15//
16// An output module that displays the words "Hello, world!" on the screen.
17//
18void hello()
19{
20 std::cout << "Hello, world!" << std::endl;
21}