Tuesday 24 December 2013

Write a program to find the greatest of the 3 numbers entered through the keyboard.


#include<iostream.h>

#include<conio.h>

main()

{

   int num1,num2,num3;

   clrscr();

   cout<<"Enter three numbers:\n";

   cin>>num1;

cin>>num2;

cin>>num3;


if (num1>num2&&num1>n3)

   {

cout<<num1<<" is greater.";

           }else

    if(num2>num3&&num2>num1)

     {cout<<"\n%d is greater."<<n2;

      }else

        cot<<"\n%d is greater."<<n3;

   getch();

}

No comments:

Post a Comment