Dividing one integer by another integer in C++ may not give you the result you are expecting.  Explain, including an example, what occurs in C++ when one integer is divided by another integer.

What will be an ideal response?


Answers may vary due to the example given.

When both the dividend and divisor are integers, the quotient is always an integer in C++.  For example, the result of the expression 24 / 5 is the integer 4 rather than the real number 4.8.

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1. When a text file is created in Visual Basic using a StreamWriter, the extension .txt is automatically added to the file name if no other extension is specified. 2. In the following statement, sw is the name of a variable. ``` Dim sw As IO.StreamWriter = _ IO.File.CreateText("C:\TEXT FILES\INCOME Data.txt") 3. If an existing text file is opened for output, the computer will append any new data to the end of this existing file. 4. If the value of IO.File.Exists(filespec) is True, then the specified file exists. 5. An individual item of a text file cannot be changed or deleted directly. ```

Computer Science & Information Technology

The Smart Lookup tool enables you to look up definitions with Bing

Indicate whether the statement is true or false

Computer Science & Information Technology

Holding down the Alt key on the keyboard and pressing the Tab key is an example of a key ________

A) combination B) tag C) pairing D) group

Computer Science & Information Technology

Many search engines support the use of the _____ shortcut key combination to display the Find bar. 

A. CTRL+S B. ALT+F C. ALT+L D. CTRL+F

Computer Science & Information Technology