+ 1

exception

Rearrange the code to declare two integer variables: a and b, print to the screen the division equation a/b. If b is equal to 0, throw an exception with a 0 value. cin >> a >> b; int a; int b; throw 0; cout << a / b << endl; if (b == 0)

9th Apr 2017, 4:04 AM
sankavi v
3 Answers
+ 5
int a; int b; cin >> a >> b; if (b == 0) throw 0; cout << a / b << endl;
9th Apr 2017, 4:08 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
0
int a; int b; cin >> a >> b; if (b == 0) throw 0; cout << a / b << endl;
20th Jul 2017, 5:57 AM
Kawin Anto N
Kawin Anto N - avatar
0
Rearrange the code to declare two integer variables: a and b, print to the screen the division equation a/b. If b is equal to 0, throw an exception with a 0 value. Answer: int a; int b; cin >> a >> b; if (b == 0) throw 0; cout << a / b << endl;
22nd Sep 2020, 10:46 PM
OjeifoIduma