CJCoding With Joseph
15free / daySign inCreate account
← Back to Question List

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics:
C++ Quiz #118

decltype and Integer Division

easyTemplates

decltype gives each variable the type of the expression inside the brackets. What is printed?

📄 Code

1#include <iostream>
2 
3int main() {
4 decltype(5 / 2) a = 5 / 2;
5 decltype(5 / 2.0) b = 5 / 2.0;
6 std::cout << a << " " << b << "\n";
7 return 0;
8}