GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
89 views
Which of the following is a checked dynamic semantic error in C?
A. Use of uninitialized variable
B. Access off the end of an array
C. wrong number of parameters passed to a function
D, Divide by zero

In my opinion B is correct answer, But D is given in solution
asked in Compiler Design by Veteran (11.5k points)   | 89 views

2 Answers

+1 vote
Best answer

there are 2 types of exceptions
1)checked- the classes which extends "Exception" class are called checked exceptions
2)unchecked- the classes which extends "runtimeexception" class are called unchecked exceptions
optionB arrayIndexOutOfBounds class extends RunTimeException class hence its unchecked 
optionD dividedByZero class extends "Exception" class hence its checked.
so option is D

ref:https://www.google.co.in/search?sourceid=chrome-psyapi2&ion=1&espv=2&ie=UTF-8&q=checked%20vs%20unchecked%20exception&oq=checked%20vs%20&aqs=chrome.0.0j69i57j0l4.4262j0j4
ref:http://way2java.com/tag/array-index-out-of-bounds-exception/

answered by Boss (9.4k points)  
selected by
@vijay How can we answer on basis of JAVA a C question?? C have no classes concept. Here option b and d both should be correct in context to C language.
as they specifically mentioned abt "checked" i answered that way
+1 vote

Checked: are the exceptions that are checked at compile time.

Unchecked are the exceptions that are not checked at compiled time. Means at run time

Access off the end of an array- happen at runtime

Divide by zero -happen at copile time

 

answered by (337 points)  
Perfect!

Related questions

0 votes
2 answers
1
asked in Compiler Design by prasitamukherjee Loyal (3.4k points)   | 162 views
+1 vote
2 answers
2
Top Users Jan 2017
  1. Debashish Deka

    7172 Points

  2. Habibkhan

    4696 Points

  3. Vijay Thakur

    4308 Points

  4. sudsho

    4090 Points

  5. saurabh rai

    4024 Points

  6. Arjun

    3292 Points

  7. santhoshdevulapally

    3066 Points

  8. GateSet

    3016 Points

  9. Bikram

    3014 Points

  10. Sushant Gokhale

    2892 Points

Monthly Topper: Rs. 500 gift card

18,838 questions
23,808 answers
51,589 comments
20,148 users