Anna wants to write a program that counts the number of students in a school. Which data type should she use for the count?
- bool
- float
- int
- string
Anna should use the 'int' (integer) data type. Integers are used for storing whole numbers, which is ideal for counting discrete items like the number of students. It provides efficient memory usage and supports mathematical operations.
Loading...
Related Quiz
- What does the break statement do in a loop structure?
- The ______ loop in C++ is unique because it evaluates its condition after executing the loop body, ensuring the loop body runs at least once.
- The ______ operator is used to check if two operands are equal.
- Ethan is writing a large C++ project. To maintain clarity, he wants to keep function declarations separate from their definitions. How might he structure his program to achieve this?
- What potential issue might arise when using switch-case statements with enumerated types?