CS Electrical And Electronics
@cselectricalandelectronics

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?
CS Electrical And Electronics Staff asked 4 years ago

info

1 Answers
CS Electrical And Electronics Staff answered 4 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.