Search This Blog

Friday, 21 August 2020

Class Concept

 #include<iostream>

using namespace std;

 class classA

 {

  int a,b;

  public:

  void getValue(int , int);

  void showValue();

 };

 void classA::getValue(int i,int j)

 {

  a=i;

  b=j;

 }

 void classA::showValue()

 

 {

  cout<<"value of A is:"<<a<<endl;

  cout<<"Value of B is: "<<b;

 

 }

 int main()

 {

  classA a;

  a.getValue(5,10);

  a.showValue();

  return 0;

 

 }


No comments:

Post a Comment

Search This Blog

Contact Form

Name

Email *

Message *

Popular Posts