← Back to archive

Stdle #44 · conversions · 2026-07-20

What does this C++ snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

#include <iostream>
int main() {
int a = 7, b = 2;
std::cout << a / b << "\n";
std::cout << static_cast<double>(a) / b << "\n";
return 0;
}
Conversions
2 lines
4 attempts left

Answer & explanation