Sunday, 27 November 2011

C++ Program For Value Passing In Class Function


#include<iostream.h>
#include<conio.h>
class test
 {
  int a,b;
  void add(int x, int y)
   {
    int c;
a=x;
b=y;
c=a+b;
cout<<c;
   }
  };
 void main()
 {
  test ob;
  ob.add(6,7);
  getch();
 }

No comments:

Post a Comment