Hello World using Function in C++


This is a C++ program that prints "Hello World!!!" to the console using a function called call(). The program begins with the inclusion of the input/output stream library iostream. This allows the program to use the cout object, which is used to print text to the console.

The call() function is defined to print the text "Hello World!!!" to the console using the cout object. The function does not take any parameters and does not return any value. In the main() function, the call() function is called, which results in "Hello World!!!" being printed to the console. Finally, the program returns 0, indicating that it executed successfully.

Source Code

#include <iostream>
using namespace std;
void call()
{
    cout<<"\nHello World!!!";
}
int main()
{
    call();
    return 0;
}
To download raw file Click Here

Output

Hello World!!!

Program List


Flow Control

IF Statement Examples


Switch Case


Goto Statement


Break and Continue


While Loop


Do While Loop


For Loop


Friend Function in C++


String Examples


Array Examples


Structure Examples


Structure & Pointer Examples


Structure & Functions Examples


Enumeration Examples


Template Examples


Functions


Inheritance Examples

Hierarchical Inheritance


Hybrid Inheritance


Multilevel Inheritance


Multiple Inheritance


Single Level Inheritance


Class and Objects

Constructor Example


Destructor Example


Operator Overloading Example


Operator and Function Example


List of Programs


Pointer Examples


Memory Management Examples


Pointers and Arrays


Virtual Function Examples