Computers and Technology

Not too sure what is wrong with the following code. I believe that it is something to do with the denominator being zero but not sure.
NOTE: in mathematics, division by zero is undefined. So, in C++, division by zero is always an error.
Given a int variable named callsReceived and another int variable named operatorsOnCall write the necessary code to read values into callsReceived and operatorsOnCall and print out the number of calls received per operator (integer division with truncation will do).
code:
cin >> callsReceived;
cin >> operatorsOnCall;
if ( operatorsOnCall > 0)
cout << (callsReceived / operatorsOnCall );

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, karleebowling316
Asuccessful format string attack attempted to steal user account information by reading from unauthorized memory. answer the followings with proper explanation a)this attack will lead to violation of which security policies?
Answers: 2
image
Computers and Technology, 22.06.2019 00:50, Cnolteb5663
Is one of the most injurious events that can happen to a person in a crash.
Answers: 1
image
Computers and Technology, 23.06.2019 00:30, alex7078
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, jayjay5246
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
Do you know the correct answer?
Not too sure what is wrong with the following code. I believe that it is something to do with the de...

Questions in other subjects: