Lisa is trying to divide 15 by 2 and get an integer result. Which operator should she use in C++?
- /
- %
- //
- ÷
In C++, to perform integer division and get the quotient as an integer result, Lisa should use the '/' operator. The '%' operator is used to calculate the remainder in integer division. The other options are not valid C++ operators for division.
Loading...
Related Quiz
- The result of 5.5 + 2.5 in C++ is _______.
- If no cases match in a switch statement and there's no default clause, then none of the switch blocks will execute.
- Which of the following containers in the Standard Template Library (STL) allows duplicate elements and keeps them in sorted order?
- In a for loop, if a continue statement is executed, then the control jumps to _______.
- In a large-scale C++ project, two classes, Logger and FileHandler, are tightly coupled, sharing a lot of private data between them using friendship. How might you refactor these classes to reduce coupling without losing functionality?