You are on page 1of 1

Friend 5

============================================
#include <iostream.h>
class Sum{
public:
Sum(int a, int b){no1=a;no2=b;}
friend int sum(Sum f);
private:
int no1;
int no2;
};

int sum(Sum f){return f.no1+f.no2;}

void main()
{
int n1,n2;
cout<<"\nEnter the No1: ";
cin>>n1;
cout<<"\nEnter the No2: ";
cin>>n2;
Sum f(n1,n2);
cout<<"\nSum of "<<n1<<"+"<<n2<<" = "<<sum(f);
cout<<endl<<endl;
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006