Write a Cpp code to display Hello world by creating objects and class?

All QuestionsCategory: Cpp LanguageWrite a Cpp code to display Hello world by creating objects and class?
Chetan Shidling Staff asked 5 years ago

info

1 Answers
Chetan Shidling Staff answered 5 years ago

Code:

#include <iostream>
using namespace std;
class abc
{
public:
void show();

};
void abc::show()
{
cout<<“Hello Everybody!!!”;
}
int main()
{
abc ob1;
ob1.show();
return 0;
}

Output:

Hello Everybody!!!
Process returned 0 (0x0) execution time : 0.027 s
Press any key to continue.