← Back to archive

Stdle #145 · conversions · 2026-10-29

What does this C++ snippet output?

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

#include <iostream>
int main() {
std::cout << std::boolalpha;
std::cout << static_cast<bool>(5) << "\n";
std::cout << static_cast<bool>(0) << "\n";
return 0;
}
Conversions
2 lines
4 attempts left

Answer & explanation