1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Reil [10]
3 years ago
12

How can an exception be explicitly raised in C++? How are exceptions bound to handlers in C++?

Computers and Technology
1 answer:
xenn [34]3 years ago
4 0

Answer:

Exceptions are raised using throw statement in c++.

Explanation:

Try block is used to keep the statements which we felt that they will raise an exception. Catch block is used to catch the exception which is thrown by the try block.

#include<iostream.h>

void main(){

int x,y,z;

try{

cout<"enter 2 numbers";

cin>>x>>y;

if(y==0)

throw y;

z=x/y;

}

catch(int x){

cout<<"exception caught";

}

}

You might be interested in
The following program is suppose to use the sin() function in the math library and write out an input's absolute value over an i
Elza [17]

Answer:

#include <stdio.h>

#include <math.h> /* has sin(), abs(), and fabs() */

int main(void) {

   double interval;

   int i;

   for(i = 0; i <30; i++) {

       interval = i/10.0;

       printf("sin( %.1lf ) = %.3lf \t", interval, abs(sin(interval)));

   }

   printf("\n+++++++\n");

   return 0;

}

Explanation:

The C source code defines a void main program that outputs the absolute value of the sine() function of numbers 0.1 to 3.0.

3 0
3 years ago
20. Which of the following describes an acceptable print resolution?
vodka [1.7K]
The correction is C.
One of the major factors that determine the quality of a printer is the resolution of that printer. The resolution is also called DPI [Dots Per Inch]. The DPI refers to amount of ink that an inkjet printer can place in a one inch line of a printed document. The higher the DPI of a printer, the higher the resolution.
6 0
3 years ago
Read 2 more answers
What does a program do when it needs to read a file?
Alja [10]
Hello <span>Quinshayewilli7701 </span>

Question: What does a program do when it needs to read a file?<span>
Answer: It goes the address area, which is the front of the hard drive with the links to the areas on the hard drive where the file is located.

Hope This helps
-Chris</span>
5 0
3 years ago
Explain mportance of using Microsoft Excel in pharmaceutical science​
goldenfox [79]

Answer:

research the question and go to setting and press advanced search and it will give answer

4 0
3 years ago
Which would take more storage space, a layer file showing all the us counties or a layer file showing all the us states?
Ksju [112]
All counties. Much more info. Although most layers are just excel files with geographical reference data in them. That one file may be several MB as the state file may be 1mb or less
5 0
3 years ago
Other questions:
  • Select the correct statement about data preparation.
    10·1 answer
  • A. True <br><br> b. False: most modern computers can understand and execute pseudocode.
    7·1 answer
  • True or false? any webb app can be accessed and run on any computing
    12·1 answer
  • (Display nonduplicate words in ascending order)
    11·1 answer
  • Use the ______ attribute to configure the browser to render default table and table cell borders.
    12·1 answer
  • Implement (in Java) the radixSort algorithm to sort in increasing order an array of integer positive keys. public void radixSort
    13·1 answer
  • In Microsoft Word you can access the _______ command from the "Mini toolbar".
    7·1 answer
  • When you take photos with your smartphone or camera, the files are most likely stored on which type of storage device A. Compute
    11·2 answers
  • If you created a variable called name, what data type would that value be?
    7·2 answers
  • How to run angular project from github.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!