1 //06-Boolean type. cpp: The entry point that defines the console application. 2 //3 4#include"stdafx.h"5#include <iostream>6 using namespacestd;7 8 intMain ()9 {Ten BOOLA =true;//true existence of non 1 One BOOLb =false;//false does not exist 0 Acout << a << Endl;//The direct Output boolean value is 1 . - -A = -; thecout << a << Endl;//Although it is 100, the output is 1 because the non-0 output value is 1 -cout << b << Endl;//The output result is 0. - - //0 1 2.....true false ' a ' these values are constants, and you can add a const before the variable to define the variable as a constant. + Const intj = -;//If you need a value that never changes, you can set the constant to prevent it from being modified. - inti = -; +i = -; Acout << J <<Endl; at - intT; -CIN >>T; - return 0; -}
C + + Programming Fundamentals 106-Boolean type