write a program of find largest of three numbers in c++

Download easy notes of C++                                                                  c++ programs

#include<iostream.h>

#include<conio.h>

class largest

{

public:

int a ,b,c;

void input()

{

cout<<"enter three marks";

cin>>a>>b>>c;

};

void show()

{

if(a>b)

{

if(a>c)

cout<<"a is greater:"<<a;

else

cout<<"c is greter:"<<c;

}

else

{

if(b>c)

cout<<"b is greter:"<<b;

else

cout<<"c is greater:"<<c;

}

}

};

void main()

{

clrscr();

  largest obj;

  obj.input();

  obj.show();

  getch();

  }

Post a Comment

0 Comments