PROGRAM OF C++ find greatest of three numbers.


Program. To find greatest of three numbers.

1. Prog. To find greatest of three numbers.

#include
#include
void main()
{
clrscr();
int a,b,c;
cout<<"\n\tEnter the first number :";
cin>>a;
cout<<"\n\tEnter the second number :";
cin>>b;
cout<<"\n\tEnter the third number :";
cin>>c;
if(a>b && a>c)
{
cout<<"\n\tFirst number is greatest";
}
if(b>a && b>c)
{
cout<<"\n\tSecond number is greatest";
}
if(c>a && c>b)
{
cout<<"\n\tThird number is greatest";
}
getch();
}



OUTPUT

Enter the first number:2

Enter the second number:3

Enter the third number:4

Third number is greatest_


Comments

Guest Author: deepikani10 Aug 2013

Its very useful to me. thank you so much.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: