Explore a little.C ProgrammingC++HTMLVisual BasicSystem AnalysisE-CommerceBCA Notes
LEARN SOMETHING NEW

C++ Program to print "Hello World" using Class

Read4BCA learning libraryFree access

C++ Program to print "Hello World" using Class

//C++ program to print "hello world" using class
//header files
#include<iostream.h>
#include<conio.h>

//creating class
class Message
{
public:

void display()
{
cout<<"Hello World";
}

};
void main()
{

Message a;      //creating object
a.display();       //calling the functionl
getch();

}
//now run the program using ctrl+f9

Output

C++ Program to print "Hello World" using Class example

You can also see a video how to run this program

This lesson preserves the original Read4BCA material. Some programming examples use older tools and syntax. View original page.