C++ Booleans
π C++ Booleans
C++ mein Boolean (bool) data type ka use true / false values store karne ke liye hota hai.
Ye conditions, decision making, loops ka base hai.
πΉ 1. Boolean Declaration
-
trueβ 1 -
falseβ 0
πΉ 2. Boolean Output
Output:
πΉ 3. Print true / false as Text
Output:
πΉ 4. Boolean from Comparison
πΉ 5. Boolean in if Statement
πΉ 6. Boolean with Logical Operators
πΉ 7. Boolean User Input
π User 1 (true) ya 0 (false) enter karta hai.
πΉ 8. Boolean Size
β‘ Usually 1 byte
β Common Mistakes
β Correct:
π Summary
-
boolsirf true/false store karta hai -
Default output = 1 / 0
-
boolalphase readable output -
Conditions & loops ke liye essential
