You are on page 1of 3

#include <iostream>

using namespace std;

class A{

public:

int x1,x2;

int a1(int num1,int num2,int num3){

return num1+num2+num3;

int a2(int t1, int t2){

if (t1>t2)

return t1;

else

return t2;

};

class B{

public:

void B1(){

cout<<"the odd numbers between 1 to 10:";

for(int i=1;i<=10;i++){

if(i%2!=0)

cout<<i<<endl;

double B2(int n1,int n2){


double avg=0;

avg=(n1+n2)/2;

return avg;

};

int main()

A a;

B c;

a.x1=50;

a.x2=30;

cout<< "the two varibles is:"<<a.x1<<","<<a.x2<<endl;

int x=1,y=2,z=3;

cout<<"the sum of three numbers: "<<a.a1(x,y,z)<<endl;

int s=6,r=20;

cout<<"the maximum number " <<a.a2(s,r)<<endl;

c.B1();

int k=9,l=4;

cout<< "the average of two numbers: "<<c.B2(k,l)<<endl;

return 0;

You might also like