#include
Saturday, October 24, 2009
An Example of Exception Handling in C++
An Example of Exception Handling in C++
#includeusing namespace std;int main(){ unsigned int TypeOfLoan = 0; const char *LoanType[] = { "Personal", "Car", "Furniture", "Musical Instrument", "Boat" }; try { cout << "Enter the type of loan\n"; for(int i = 0; i < 4; i++) cout << i + 1 << ") " << LoanType[i] << endl; cout << "Your choice: "; cin >> TypeOfLoan; if( TypeOfLoan < 1 || TypeOfLoan > 5 ) throw "Number out of range\n"; cout << "\nType of Loan: " << LoanType[TypeOfLoan] << endl; } catch(const char* Msg) { cout << "Error: " << Msg << endl; } catch(...) { cout << "\nSomething went wrong\n\n"; } return 0;}
#include
Subscribe to:
Post Comments (Atom)
Popular Posts
-
कुणीतरी आठवणं काढतय कुणीतरी आठवणं काढतय वैभव जोशी कुणीतरी आठवणं काढतय, बाकी काही नाही...... कुणीतरी आठवणं काढतय, बाकी काही नाही...... बाकी क...
-
??? ?????????? ??????????? ???? ????? ???? ??????? ??? ?????? ?????? ????? ??? ???? ! ????????? - ??????? ????? ??????????? ??? ????? ??...
-
Western, Central and Harbour railway map (click on the map to see full view)
-
Starring :Amitabh Bachchan, Sridevi, Jayapradha, Om Shivpuri, Anupam Kher, Sadashiv Amrapurkar, Dalip Tahil (aakhri rasta,akhree raastha,ak...
-
KALYAN DOMBIVALI DOCTORS AND HOSPITAL LIST DOCTORS DR (MISS) ...
-
The tab is easily one of the most used feature in Firefox. It gives you the convenience of browsing different sites in one single window an...
-
Marathi movie Galgale Nighale download MOVIE INFO Released : 29th August 2008 Genre : Comedy Starcast : Bharat Jadhav, Siddhart Jadhav, Rame...
-
SOUTH INDIAN BANK - IFSC Codes IFSC Code Branch Name Address SIBL0000001 ALAPPUZHA "ALAPPUZHA BRANCH,SD PHARMACY BUILDIN...
-
Trekking spot - SHIVNERI Birth Place Of Shivaji Maharaj Shivneri ( Birth Place Of Shivaji Maharaj ) HISTORY Chhatrapati Shivaji Maharaj - T...
-
Academics • University Grants Commission - www.ugc.ac.in • Central Board Of Secondary Education - www.cbsc.nic.in • Delhi University - ww...
No comments:
Post a Comment