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
Match the items with their respective descriptions.
kap26 [50]

a is 3

b is 1

c is 2

d is 4

7 0
3 years ago
Read 2 more answers
Identify the equation that translates Y = In(x) five units down.​
Tatiana [17]
Y=In(x)-5
hopefully it’s right :)
4 0
3 years ago
The Earth receives different amounts of energy from the Sun in each hemisphere because
Lady bird [3.3K]

Answer:

The Sun is much larger than the other stars. ... A planet has less mass than a galaxy and more mass than the star it orbits. A galaxy has less mass than a moon and more mass than a planet.

Explanation:

8 0
3 years ago
Read 2 more answers
Which of the following statements about global variables is true? 1.A global variable is accessible only to the main function. 2
Korvikt [17]

Answer:

A global variable can have the same name as a variable that is declared locally within the function.

Explanation:

In computer program, we refer to a global variable as that variable that comes with a global perspective and scope, ensuring its visibility throughout the program, except it is shadowed. The set of this kind of variable is referred to as global state or global environment. One feature of global environment is that it can have similar name as a variable declared locally within the function.

7 0
3 years ago
.When might you want to use static IP addressing?
nikitadnepr [17]

Answer:

You might use static ip addressing when your network will be small and you don´t have plans to create a bigger network from this.

Explanation:

When you use static ip addressing you have to configure the routes between hosts manually, is easy to define this rules manually when your network is small because you know all the addresses and the routes to configure. But if your network is bigger and you didn´t know all the host addresses will take a long time to configure this manually.

4 0
3 years ago
Other questions:
  • 7. Write a program in C to display the string "ARRAY" in the following format : A AR ARR ARRA ARRAY
    5·1 answer
  • Which type of address defines a single network interface in a computer or other device?
    7·1 answer
  • Write a program that implement a bubble sort ?
    5·1 answer
  • The double equal sign (==) is used to compare values. <br>true or false​
    14·1 answer
  • C programmig : Output all combinations of character variables a, b, and c, using this ordering:abc acb bac bca cab cbaSo if a =
    12·2 answers
  • You are creating a presentation and you have come to the last slide. you still have more information to add. what should you do?
    10·2 answers
  • Conner has located a research source that is sponsored by a pharmaceutical company. Based on the sponsorship, Conner must be car
    8·1 answer
  • What defines interactive media? The user must play a role in writing the content of the media. The user must do something that d
    6·2 answers
  • how does the use of data abstraction manage complexity in program code? how does using lists make a program easier to develop an
    5·1 answer
  • Question 1 of 10
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!