Skip to content · ⁨본문 바로가기⁩
English

True and false in C

  • C has no separate true/false type by default. It uses numbers: 0 means false, and any other number means true.
  • A test like 5 > 3 produces 1 (true). 5 < 3 produces 0 (false).
  • (If you #include <stdbool.h> you can write bool, true, and false — but plain int works everywhere.)
한국어

C의 참과 거짓

  • C는 기본적으로 true/false 타입이 없습니다. 숫자를 사용합니다: 0은 거짓(false), 그 외의 모든 숫자는 참(true) 을 의미합니다.
  • 5 > 3 같은 테스트는 1(참)을 생성합니다. 5 < 3은 0(거짓)을 생성합니다.
  • (#include <stdbool.h>을 if하면 bool, true, 그리고 false을 쓸 수 있지만, plain int은 어디든 작동합니다.)

Handout · ⁨교재 자료⁩

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP