Become a GOLD member of Deccansoft and get access to 40+ courses!!
NewBatches/Webinars
Packages
Gold Membership
Bestseller
Microsoft Azure Suite & Suite Plus
Power Platform Acadamy
New
Azure DevOps Expert & Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Courses
MS.NET Courses (Includes Live Project)
Complete C#, OOPs and Windows Programing
ASP.NET MVC Online Training
ASP.NET WebForms
ASP.NET Core
WCF incl. Web Services and Remoting
WPF incl. MVVM and Prism
LINQ and Entity Framework
Live Project Training for Developing Enterprise Application
Live Project using Ntier Arch (.NET5 + EF Core + Angular)
Gold Membership
CareerStep IT Program
Client-side UI Technologies
Building Static Web Pages using HTML and CSS
JavaScript and HTML DOM
jQuery, AJAX and JSON
Building Interactive Web Pages using HTML5 and CSS3
BootStrap + Live Examples
AngularJS + Live Project
Angular + Typescript
ReactJS
KnockoutJS
Xamarin
SQL Server + MSBI
SQL Server 2017
Querying Data with Transact-SQL(70-761)
SQL Server Integration Service (SSIS)
SQL Server Reporting Service (SSRS)
SQL Service Analysis Service (SSAS)
Cloud Computing / Azure / AWS
AZ-900: Microsoft Azure Fundamentals
Azure Suite (AZ-104+AZ-204+AZ-305+ AZ-500)
AZ-104: Microsoft Azure Administrator
AZ-204: Developing Solutions for Microsoft Azure
AZ-305: Microsoft Azure Architect Technologies and Design
AZ-400: Microsoft Azure DevOps
DP-203: Data Engineering on Microsoft Azure
Amazon Web Services (AWS)
Testing Tools
Manual Testing
Selenium Testing with Java(Live Training)
SharePoint
SharePoint 2013
Microsoft Power Platform
Microsoft Power Platform
Data Analytics using PowerBI (DA-100)
DevOps
Docker
Kubernetes
Microservices using .NET Core
Others
C and Data Structure
Core Java
OOPs and C++
Advance Java
Python Programming
Complete Azure Training
Pricing
Videos
Testimonials
Azure Certification
Contact Us
Login
Login or Register
×
Sign In
Register
Forgot Password?
How did you find us
WhatsApp
YouTube
LinkedIn
Facebook
Telegram
Twitter
Google
Referred by Friend
Refresh
Input symbols
By clicking Register, you accept to the
terms and conditions
and that you have read our
privacy policy.
Recover Password
×
Submit
Enquiry Now
Where did you come to know about us
WhatsApp
YouTube
LinkedIn
Facebook
LinkedIn Ad
Email
Twitter
Google
Referred
Other
Refresh
Input symbols
Exception Handling
Interview Questions and Answer
1. What type of Exceptions does C++ handle?
Options:
a. Synchronous
b. Asynchronous
c. Both
d. None
Reveal Answer
2. Where does the program control transfers to when exception arises?
Options:
a. catch
b. handlers
c. Throw
d. none of the mentioned
Reveal Answer
3. Which keyword is used to check exception in the block of code?
Options:
a. catch
b. throw
c. try
d. none of the mentioned
Reveal Answer
4. What will happen when the exception is not caught in the program?
Options:
a. error
b. program will execute
c. block of that code will not execute
d. none of the mentioned
Reveal Answer
5. What is the output of this program? #include <iostream> using namespace std; int main() { int age = 0; try { if (age < 0) { throw "Positive Number Required"; } cout << age; } catch(const char *Message) { cout << "Error: " << Message; } return 0; }
Options:
a. 0
b. Error:Positive Number Required
c. compile time error
d. none of the mentioned
Reveal Answer
6. What is the output of this program? #include <iostream> using namespace std; void PrintSequence(int StopNum) { int Num; Num = 1; while (true) { if (Num >= StopNum) throw Num; cout << Num; Num++; } } int main(void) { try { PrintSequence(20); } catch(int ExNum) { cout << "Caught an exception with value: " << ExNum; } return 0; }
Options:
a. compile time error
b. prints first 19 numbers
c. prints first 19 numbers and throws exception at 20
d. none of the mentioned
Reveal Answer
7. What is the output of this program? #include <iostream> using namespace std; int main() { char* buff; try { buff = new char[1024]; if (buff == 0) throw "Memory allocation failure!"; else cout << sizeof(buff) << "Byte successfully allocated!"<<endl; } catch(char *strg) { cout<<"Exception raised: "<<strg<<endl; } return 0; }
Options:
a. Byte successfully allocated
b. 4
c. 4 Bytes allocated successfully.
d. 5
Reveal Answer
8. What will happen when the handler is not found for exception?
Options:
a. Calls the standard library function terminate()
b. raise an error
c. executes the remaining block
d. none of the mentioned A
Reveal Answer
9. Can we write our custom Exceptions?
Options:
a. Yes
b. No
Reveal Answer
Packages
Gold Membership
Microsoft Azure Suite &Suite Plus
Azure DevOps Expert &Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Resources
Blog
Deccansoft
AzureA2Z
Wall of Fame
On-Job Tech Support
About
About BestDotNetTraining
About Trainer
Testimonials
FAQ
Other links
About Us
Contact Us
Leave us a feedback
Sitemap
Privacy Policy
Terms & Conditions
Proudly Powered by