[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
C++ simple try and throw example
pradeepDate: Monday, 05 November 12, 5:09 PM | Message # 1
pk
Group: Administrators
Messages: 82
Status: Offline
Code
#include<iostream.h>
#include<conio.h>
int main()
{
    int a,b=50;
    cout<<"\t\t ------- [ Its make by pkhighfile ]-------\n\n";
    cout<<"\t\t**** Your current amount is Rs.50 ****\n\n \t\t  Program for catch and try  \n\n";
     cout<<"Enter call rate :- ";
     cin>>a;
     try
   {
          if(a==b)
          cout << "your call is dialing........___|------````;;;''";
                    else
                         throw(b);
                         }
                          catch(int c)
                {
                        cout<<"\n For calling you need more money !!!?\n MUST NEED Rs. "<<a-b<<"\n";
                        }
                        getch();
                        return 0;
                        }
                         
holiday holiday holiday
 
  • Page 1 of 1
  • 1
Search: