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


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: Cpp LanguageWrite a Cpp code to display Hello world by creating objects and class?
Chetan Shidling Staff asked 6 years ago

info

1 Answers
Chetan Shidling Staff answered 6 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.