C++ Program to Compare The Greatest Of Three Integers andrey понедельник, 11 августа 2014 г. No Comment

C++ program to compare which is the greatest among three numbers. An IF statement is used to set the condition to know which is less or greater than which.

#include
#include
#include
void main()
{
int a,b,c;
clrscr();
cout<<"enter the first value";
cin>>a;
cout<<"enter the second value";
cin>>b;
cout<<"enter the third value";
cin>>c;
if (a>b&&b>c)
cout<<"The greatest is: "<<a;
else
if(a<b&&b>c)
cout<<"The greatest is: "<<b;
else
if(a<b&&b<c)
cout<<"The greatest is: "<<c;
else
if(a==b&&b==c)
cout<<"Non is greater!!";
}
C++ program to compare which is the greatest among three numbers. An IF statement is used to set the condition to know which is less or greater than which.

#include
#include
#include
void main()
{
int a,b,c;
clrscr();
cout<<"enter the first value";
cin>>a;
cout<<"enter the second value";
cin>>b;
cout<<"enter the third value";
cin>>c;
if (a>b&&b>c)
cout<<"The greatest is: "<<a;
else
if(a<b&&b>c)
cout<<"The greatest is: "<<b;
else
if(a<b&&b<c)
cout<<"The greatest is: "<<c;
else
if(a==b&&b==c)
cout<<"Non is greater!!";
}
by Jillur Rahman

Jillur Rahman is a Web designers. He enjoys to make blogger templates. He always try to make modern and 3D looking Templates. You can by his templates from Themeforest.

Follow him @ Twitter | Facebook | Google Plus

No Comment