BCS-1A

Saturday, December 31, 2011

Greater or Less then in Giver three Numbers


/*****************************************************
  Name: Three number calculator
 
  Copyright: BCS-1A
 
  Author:Muhammad Hussnain Imtiaz
 
  Date: 20/12/11 22:07
 
  Description: To calculate three numbers
*******************************************************/

  // preprocesser directive
 # include <iostream>
 # include <conio.h>

 using namespace std ;

 int main ()
{
// local declaration
float num1 = 0.0 ,
      num2 = 0.0 ,
      num3 = 0.0 ,
      sum  = 0.0 ,
      ;



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


    cout <<        "      Please Enter First  Number  :   " ;
    cin  >> num1 ;
    cout << endl <<"      Please Enter Second Number  :   " ;
    cin  >> num2 ;
    cout << endl <<"      Please Enter Third  Number  :   " ;
    cin  >> num3 ;
    cout << endl ;
       

    sum = num1 + num2 + num3 ;
   
    cout <<          "           The     sum   is :   " << sum << endl << endl ;
   
   
   
    if ( num1 == num2 && num2 == num3 )
    {
       cout <<       "              All no. are equal         " ;    
    }
   
   
    if ( num1 != num2 && num2 != num3 )
    {
       cout << "          Input numbers are not equle   " << endl ;
    }
   
   
    if ( num1 > num2 && num1 > num3 )
    {
       cout << "               " << num1 << " > " << num2 << " and " << num3 << "\n" ;
    }
   
   
    if ( num2 > num3 && num3 > num1 )
    {
       cout << "               " << num2 << " > " << num1 << " and " << num3 << "\n" ;
    }
   
   
    if ( num3 > num1 && num1 > num2 )
    {
       cout << "               " << num3 << " > " << num1 << " and " << num2 << "\n" ;
    }
   

    if ( num1 < num2 && num1 < num3 )
    {
       cout << "               " << num1 << " < " << num2 << " and " << num3 << "\n" ;
    }

   
    if ( num2 < num3 && num3 < num1 )
    {
       cout << "               " << num2 << " < " << num1 << " and " << num3 << "\n" ;
    }
   

    if ( num3 < num1 && num1 < num2 )
    {
       cout << "               " << num3 << " < " << num1 << " and " << num2 << "\n" ;
    }
   
   
    if ( num1 == num2 && num1 > num3 )
    {
       cout << "First number = Second number but " << num3 << " < First and Second number \n" ;
    }
   

    if ( num2 == num3 && num2 > num1 )
    {
       cout << "Second number = Third number but " << num1 << " < Second and Third number \n" ;
    }
   

    if ( num3 == num1 && num3 > num2 )
    {
       cout <<  "First number = Third number but " << num2 << " < First and Third number \n" ;
    }
   
 
    if ( num1 == num2 && num1 < num3 )
    {
       cout << "First number = Second number but " << num3 << " > First and Second number \n" ;
    }
   

    if ( num2 == num3 && num2 < num1 )
    {
       cout << "Second number = Third number but " << num1 << " > Second and Third number \n" ;
    }
   

    else if ( num3 == num1 && num3 < num2 )
    {
       cout << "First number = Third number but " << num2 << " > First and Third number \n" ;
    }
   

    else
    {
       cout << endl << "        " ;
    }
   
       cout << endl << "                   T h a n k s               " ;
     
    cout << "\n\n\n\n\n\n      Created By : Mohammad Hussnain Imtiaz " ;

 
  getch () ;
  return 0 ;
} // end of main function

Program Using Lock


/***********************************************************
  Name: Calculate AM,GM and HM
 
  Copyright: BCS-1A
 
  Author: Muhammad Hussnain Imtiaz
 
  Date: 27/12/11 16:29
 
  Description: Program To calculat Arithmatic Mean,
                 Geomatric Mean and Harmonic Mean
***********************************************************/
// preprocesser directive
 #include<iostream>
 #include<conio.h>
 #include<cmath>
 using namespace std;
 int main()
 {
     // Local declaration
     double number       =0.0,
            sum          =0.0,
            product      =1.0,
            sumReciprocal=0.0,
            AM=0.0,
            GM=0.0,
            HM=0.0;
     int i=0,
         n=0,
         code;

     cout << "  Program To calculat Arithmatic Mean, Geomatric Mean and Harmonic Mean"
             <<endl<<endl ;
    for (i=1; code != 12345 ; i++)  // 1st for loop, just for lock
{
            cout << "\n                       Enter code :";
            cin  >> code ;
            system ("CLS");
            if (code == 12345) // 1st if loop for lock
               {
     cout << "                How many numbers you want to enter :" ;
     cin  >> n;
     cout<<endl;
     for (i=1; i<=n; i++)
     {
         cout << "                    Enter number " << i << ":";
         cin  >> number;
         sum = sum+number;
         product=product*number;
         sumReciprocal=sumReciprocal+(1.0/number);
     }// end of for loop
 // Counting AM,GM and HM
     AM=sum/n;
     GM=pow(product,1.0/n);
     HM=n/sumReciprocal;
         cout <<endl
              <<endl
              <<endl
              << "                    Arithmatic Mean :" << AM << endl;
         cout << "                    Geomatric  Mean :" << GM << endl;
         cout << "                    Harmonic   Mean :" << HM << endl;
         cout <<endl
              <<endl
              << "                     Press any key" ;
     getch();
               } // end of if
            else
               {
                cout << "          "
                     << "you enter invalid code, press 'Enter' to retry." ;
                getch();
               }
 } // end of for loop (Lock)
   
     system ("CLS");
     cout <<endl
          <<endl
          <<endl
          <<endl
          <<endl
          << "                 Created By:Mohammad Hussnain Imtiaz" ;
            getch ();
            return 0;
 }// end of main function

Thursday, December 29, 2011

More than 2 Numbers Add


/*******************************************************
*  Name: Add more than 2 numbers                       *
*                                                      *
*  Copyright: BCS-1A                                   *
*                                                      *
*  Author: Muhammad Hussnain Imtiaz                    *
*                                                      *
*  Date: 21/12/11 23:07                                *
*                                                      *
*  Description: Program to add more than 2 numbers     *
*******************************************************/

// preprocessor directive
#include<iostream>
#include<conio.h>
using namespace std ;
int main ()
{
    // Local declaration
    int marks =0 ,
        i        ,
        sum   =0 ,
        code  =0 ,
        ;
    double n      =0.0 ,
           average=0.0 ,
           ;
    cout << "          How much numbers you want to enter numbers: " ;
    cin  >> n ;
    cout << endl << endl ;
    for (i=1 ; i<=n ; i++)   // 1st for loop start
    {
    cout << "                     Enter Number " << i << ":" ;
    cin  >> marks ;
    }
        sum = sum+marks ;
    cout << "\n             System add them and their addition is " << sum  ;
        average = sum/n ;
    cout << "\n                    Their Average is " << average ;
    getch();
for (i=1; code != 12345; i++)  // 2nd for loop, just for lock
{
    system ("CLS");
    cout << "\n                  Press exit code :";
    cin  >> code ;
    if (code == 12345)
{  
     system ("CLS");
     cout << "\n\n\n\n\n\n\n\n\n\n\n     "
          << "              Created By:Mohammad Hussnain Imtiaz   " ;
} // End of if
    else
{
     cout << "          you enter invalid code, press 'Enter' to retry." ;
     getch();
}
}// end of for
   
getch () ;  
return 0 ;
} // end of main function

Wednesday, December 28, 2011

Program That judge your Age


#include <iostream>

using namespace std;

int main()                            // Most important part of the program!
{
  int age;                            // Need a variable...
 
  cout<<"Please input your age: ";    // Asks for age
  cin>> age;                          // The input is put in age
  cin.ignore();                       // Throw away enter
  if ( age < 100 )                   // If the age is less than 100
 {  
cout<<"You are pretty young!\n"; // Just to show you it works...
  }
  else if ( age == 100 )             // I use else just to show an example
  {
     cout<<"You are old\n";           // Just to show you it works...
   }
  else
   {
    cout<<"You are really old\n";     // Executed if no other statement is
   }
  cin.get();
}

Bill of Electric Store


/*****************************************************
  Name: To calculate custmer's bill
 
  Copyright: open source
 
  Author: Muhammad Hussnain Imtiaz
 
  Date: 20/12/11 12:55
 
******************************************************/

 # include <iostream>
 # include <conio.h>

 using namespace std ;

 int main ()
 {
 double unitPriceTV               = 400.00 ,
        unitPriceDVDPalyer        = 300.00 ,
        unitPriceRemoteController = 35.20  ,
        unitPriceCDPlayer         = 220.00 ,
        unitPriceTapeRecoder      = 150.00 ,
        sum1                      = 0.0    ,
        sum2                      = 0.0    ,
        ;
       
 int noOfTV              =0 ,
     noOfDVDPalyer       =0 ,
     noOfRemoteController=0 ,
     noOfCDPlayer        =0 ,
     noOfTapeRecoder     =0 ,
     ;
   
     cout << " Please    Enter    The   number   of    TV   : " ;
     cin  >> unitPriceTV     ;
   
     cout << " Please   Enter  The  number  of  DVD Palyer  : " ;
     cin  >> noOfDVDPalyer   ;
   
     cout << " Please Enter The number of Remote Controller : " ;
     cin  >> noOfCDPlayer    ;
   
     cout << " Please  Enter  The  number  of  CD    Player : " ;
     cin  >> noOfCDPlayer    ;
   
     cout << " Please  Enter  The  number  of Tape Recoder  : " ;
     cin  >> noOfTapeRecoder ;
   
     sum1 = (unitPriceTV * noOfTV) + (unitPriceDVDPalyer * noOfDVDPalyer) + (unitPriceRemoteController * noOfRemoteController) + (unitPriceCDPlayer * noOfCDPlayer) + (unitPriceTapeRecoder * noOfTapeRecoder) ;
     cout << " \n       Your bill with out  tax is : " << sum1 << "$";
   
   
     sum2 = (sum1 / 100.00) * 8.25 + sum1 ;
     cout << " \n\n              We add 8.25% sales tax "             ;
     cout << " \n       Your bill including tax is : " << sum2 << "$";
   
   
     cout << " \n\n     .................Thanks................." ;
   
     cout << " \n\n\n\n\n\n\n\n\n\n      Created By : Mohammad Hussnain Imtiaz  " ;
     getch () ;
     return 0 ;
 }

Area of Triangle Calculator


/*****************************************************
  Name: Area of triangle Calculator
 
  Copyright: BCS-1A
 
  Author: Muhammad Hussnain Imtiaz
 
  Date: 21/12/11 23:46
 
  Description: Porgram to calculate area of triangle
******************************************************/

 # include <iostream>
 # include <conio.h>
 # include <cmath>
 using namespace std ;

 int main ()
 {
// local declaration
 double    a=0.0,
           b=0.0,
           c=0.0,
        area=0.0,
           s=0.0,
           ;
           cout << "        Area of Triangle calculater     " << endl << endl ;
           cout << " Enter 'y' to continue and 'n' to exit :" ;
while (getche() != 'n')
{
           system("CLS");
           cout << endl << endl;
           cout << " Please Enter the side-1 of Triangle :" ;
           cin  >> a ;
           cout << " Please Enter the side-2 of Triangle :" ;
           cin  >> b ;
           cout << " Please Enter the side-3 of Triangle :" ;
           cin  >> c ;
if( a+b>c && b+c>a && c+a>b )          
   {
     s=(a+b+c)/2.0 ;
     area=sqrt ((s*(s-a)*(s-b)*(s-c))) ;
           cout << "\n\n\n     The Area of Triangle is: " << area ;          
           if (a==b && b==c)
           {
           cout << "\n\nAll Sides of Triangle are equal in length" ;
           }
           if (a>b && a>c)
           {
           cout << "\n\n  Side-1 is Greater than other sides" ;
           }
           if (b>a && b>c)
           {
           cout << "\n\n  Side-2 is Greater than other sides" ;
           }
           if (c>a && c>b)
           {
           cout << "\n\n  Side-3 is Greater than other sides" ;
           }
           if (a<b && a<c)
           {
           cout << "\n\n     Side-1 is Less than other sides" ;
           }
           if (b<a && b<c)
           {
           cout << "\n\n     Side-2 is Less than other sides" ;
           }
           if (c<a && c<b)
           {
           cout << "\n\n     Side-3 is Less than other sides" ;      
           }
           cout << "\n\n\n  Enter 'y' to continue and 'n' to exit :" ;
   }// End of if
   else
   {
           cout << "\n        Triangle is not Constructed" ;
           cout << "\n\n\n  Enter 'y' to continue and 'n' to exit :" ;
   }//end of else
}// end of while
           system ("CLS");
           cout << "\n\n\n\n\n\n\n\n\n\n\n\n               "
                << "   Created By:Mohammad Hussnain Imtiaz " ;
     getch ();
     return 0;  
 }// end of main function

Greater or Less then in Giver 3 Numbers


/*
   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

Result Card


/********************************************************************************
  Name: Result Card

  Copyright: BCS-1A

  Author: Muhammad Hussnain Imtiaz

  Date: 25/12/11 13:01

  Description: result card of seven subjects
*********************************************************************************/

 # include <iostream>
 # include <conio.h>
 # include <string>

 using namespace std ;
 int main()
 {
//   Local declaration
 int rollNo   =0,
     subject1 =0,
     subject2 =0,
     subject3 =0,
     subject4 =0,
     subject5 =0,
     subject6 =0,
     subject7 =0;
 string name ;
 double percentage=0.0,
        sum      = 0.0,
        totalMark= 0.0;

 cout << "Enter your name :" ;
 getline (cin, name);
 cout << "Enter Roll Number :" ;
 cin  >> rollNo ;

 cout << "Enter your 1st subject Maks :" ;
 cin  >> subject1 ;
 cout << "Enter your 2nd subject Maks :" ;
 cin  >> subject2 ;
 cout << "Enter your 3rd subject Maks :" ;
 cin  >> subject3 ;
 cout << "Enter your 4th subject Maks :" ;
 cin  >> subject4 ;
 cout << "Enter your 5th subject Maks :" ;
 cin  >> subject5 ;
 cout << "Enter your 6th subject Maks :" ;
 cin  >> subject6 ;
 cout << "Enter your 7th subject Maks :" ;
 cin  >> subject7 ;
 cout << "\nEnter Total Marks :" ;
 cin  >> totalMark ;

 sum = subject1 + subject2 + subject3 + subject4 + subject5 + subject6 + subject7 ;
 percentage = (sum / totalMark) * 100.0 ;
 system ("CLS") ;
 cout << "*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*";

 cout << endl << "  Name :"           << name       ;
 cout << endl << "  Roll No. :"       << rollNo     ;
 cout << endl << "          1st Subject Marks :" << subject1;
 cout << endl << "          2nd Subject Marks :" << subject2;
 cout << endl << "          3rd Subject Marks :" << subject3;
 cout << endl << "          4th Subject Marks :" << subject4;
 cout << endl << "          5th Subject Marks :" << subject5;
 cout << endl << "          6th Subject Marks :" << subject6;
 cout << endl << "          7th Subject Marks :" << subject7;
 cout << endl << " Total Marks :" << totalMark << "        Obtained Marks :" << sum        ;
 cout << endl << " Percentage :"     << percentage ;
 cout << endl ;

 if (percentage>=90.0)
 {
 cout << " Grade :A+" ;          
 }
 else if (percentage>=80.0)
 {
 cout << " Grade :A" ;  
 }
 else if (percentage>=70.0)
 {
 cout << " Grade :B" ;  
 }
 else if (percentage>=60.0)
 {
 cout << " Grade :C" ;  
 }
 else if (percentage>=50.0)
 {
 cout << " Grade :D" ;  
 }
 else if (percentage>=40.0)
 {
 cout << " Grade :E" ;  
 }
 else if (percentage<40.0)
 {
 cout << " Grade :F" ;  
 }
 cout << endl << "*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*" ;

 cout << "\nPress any key" ;
 getch ();
 system ("CLS");
 cout << "\n\n\n\n\n\n\n\n\n                  Created By:Mohammad Hussnain Imtiaz" ;
 getch () ;
 return 0 ;
 }

Love Percentage


/****************************************************************
  Name: Love Percentage
 
  Copyright: BCS-1A
 
  Author: Muhammad Hussnain Imtiaz
 
  Date: 22/12/11 00:50
 
  Description: just For Fun and Entertainment
*****************************************************************/
 # include <iostream>
 # include <conio.h>
 # include <string>

 using namespace std ;

 int main ()
{
//   Local declaration
   string name1,
          name2;
   double num1 = 0.0 ,
          ans  = 0.0 ;
   int i=0 ;
   cout << "             ......Love Percentage......   " << endl ;
   cout << "              Enter your Name: "    ;
   getline (cin,name1) ;
   cout << "              Enter Your Lover Name: " ;
   getline (cin,name2) ;
   cout << "\n              Enter  your  Lucky  number  \n"
        << "          (Please only use less than 100) : " ;
   cin  >> num1 ;
   cout << endl ;
   if ( num1<=30 )
   {
   ans = num1 * 2.0 ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;  // Space strings are just use for beauty in executed program
   cout << "            Your love Percentage is : " << ans << " % " ;
   cout << "\n       *******************************************";
   }
 
   else if ( num1>30 && num1<=40 )
   {
   ans = num1 * 1.2 ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;
   cout << "            Your Love Percentage is : " << ans << " % " ;
   cout << "\n       *******************************************";
   }
 
   else if ( num1>40 && num1<=50 )
   {
   ans = num1 + 30.0986551 ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;
   cout << "            Your Love Percentage is : " << ans << " % " ;
   cout << "\n       *******************************************";
   }
 
   else if ( num1>50 && num1<=60 )
   {
   ans = num1 * 0.99999 ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;
   cout << "            Your Love Percentage is : " << ans << " % " ;    
   cout << "\n       *******************************************";
   }
 
   else if ( num1>60 && num1<=70 )
   {
   ans = num1 / 1.593443 ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;
   cout << "            Your Love Percentage is : " << ans << " % " ;    
   cout << "\n       *******************************************";
   }
 
   else if ( num1>70 && num1<=80 )
   {
   ans = num1 + 13.0 ;
   cout << "       *******************************************\n";
   cout << "                   " << name1 << " and " << name2 << endl ;
   cout << "            Your Love Percentage is : " << ans << " % " ;
   cout << "\n       *******************************************";
   }
 
   else if ( num1>80 && num1<=90 )
   {
   ans = (num1 / 5.11)*2 ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;
   cout << "            Your Love Percentage is : " << ans << " % " ;    
   cout << "\n       *******************************************";
   }
 
   else if ( num1>90 && num1<=95 )
   {
   ans = num1 / 1.3 ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;
   cout << "            Your Love Percentage is : " << ans << " % " ;
   cout << "\n       *******************************************";
   }
 
   else if ( num1>95 && num1<100 )
   {
   ans = (num1 / 0.999999) ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;
   cout << "            Your Love Percentage is : " << ans << " %\n";
   cout << endl ;
   cout << "                        Shoot him                   "   ;
   cout << "\n       *******************************************";
   }
 
   else if ( num1>99 && num1<101 )
   {
   ans = num1 * 0.0 ;
   cout << "       *******************************************\n";
   cout << "                    " << name1 << " and " << name2 << endl;
   cout << "            Your Love Percentage is : " << ans << " %\n";
   cout << endl ;
   cout << "                  Charachter Dheela                   " ;
   cout << "\n       *******************************************";
   }
 
   else if ( num1>100 )
   {
   cout << "\n           Your lucky number is invalid          " ;  
   }
   if ( ans>=90 )
   {
   cout << "\n\n\n                         WooooooW            " ;  
   }
 
  cout << "\n\n\n\n\n\n\n\n\n             Created By:Mohammad Hussnain Imtiaz" ;  
   getch ( ) ;
   return 0 ;
}

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

Calculator


/****************************************
   Program to calculate two numbers
         13/12/11 12:39
*****************************************/
// preprocesser directive
 # include <iostream>
 # include <conio.h>
 using namespace std ;
 int main ()
 {
     // Locaal declaration
 double num1 = 0.0,
        num2 = 0.0,
        ans  = 0.0;
 int  choice = 0  ,
      press  = 0;
 
     while ( press = 'n' )
{
        system ("CLS") ;
        cout <<         "\nPlease Enter first number : " ;
        cin  >> num1 ;
        cout << endl << "Please Enter Second number: " ;
        cin  >> num2 ;
        cout << endl ;
        cout << " Please enter \n 1 for Addition \n 2 for Substraction \n 3 for Multiplication \n 4 for Division \n\n " ;
        cout << " Please Enter your choice from one to four :  " ;
        cin  >> choice ;
        cout << endl ;
     switch ( choice )
     {
       case 1 :
            ans = num1 + num2 ;
            cout << "  We sum these two numbers and answer is : "      << ans ;
            cout << "\n        Press any key to continue" ;
            getch ( );
            break ;
     
       case 2 :
            ans = num1 - num2 ;
            cout << "  We Subtract these two numbers and answer is : " << ans ;
            cout << "\n        Press any key to continue" ;
            getch ( );
            break ;
     
       case 3 :
            ans = num1 * num2 ;
            cout << "  We Multiply these two numbers and answer is : " << ans ;
            cout << "\n        Press any key to continue" ;
            getch ( );
            break ;
           
       case 4 :
            ans = num1 / num2 ;
            cout << "  We Divide these two numbers and answer is   : " << ans ;
            cout << "\n        Press any key to continue" ;
            getch ( );
            break ;
   
      default :
            cout << "  You Enter Invelid Choice" ;
            cout << "\n        Press any key to continue" ;
            getch ( );    
     }// end of switch
}// end of while loop
            cout << "\n             Press any key" ;
            getch ( );
 system ("CLS");
 cout << "\n\n\n\n\n\n\n\n\n                  Created By:Mohammad Hussnain Imtiaz" ;
     getch ( ) ;
     return 0 ;
}