BCS-1A

Wednesday, December 28, 2011

Find Greater or Lesser Number


/*
   multi purpuse program (which number is < or > then other no. in giver three numbers)
*/

// preprocessor directives
# include <iostream>
# include <conio.h>
using namespace std ;

//start main function here
int main ()
{

    cout << "            Welcome           " << endl << endl ;

    //local diclaration
  double num1 = 0.0 ,   //first integer value
         num2 = 0.0 ,   //second integer value
         num3 = 0.0 ,   //third integer value
        ;
       
        //input three integer numbers
        cout << endl << "     Enter First  No.  :" ;
        cin  >> num1;
       
        cout << endl << "     Enter Second No.  :" ;
        cin  >> num2 ;
       
        cout << endl << "     Enter Third  No.  :" ;
        cin  >> num3 ;
       
        if ( num1 > num2 && num1 > num3 )
    {      
        cout << endl << endl
             << "\""    //   ( \" is used to print " )
             << num1
             << "\""
             << "    Is greater than " << num2 << " and " << num3
             << endl << endl
             << "            THANKS          "
             ;    
    }
   
         else if ( num2 > num1 && num2 > num3 )
    {
        cout << endl << endl
             << "\""
             << num2
             << "\""
             << "  Is greater than " << num1 << " and " << num3
             << endl << endl
             << "            THANKS          "
             ;
    }
   
        else
    {
        cout << endl
             << endl
             << "\""
             << num3
             << "\""  
             << "  Is greater than " << num1 << " and " << num2
             << endl
             << endl
             << "            THANKS          "
             ;
    }
        cout << "\n\n\n\n\n\n\n\nCreated By:Mohammad Hussnain Imtiaz" ;
    getche ( );
    return 0;
    }  //end of main function

No comments:

Post a Comment