Answers for "set value of boolean in c"

C
0

set value of boolean in c

#include <stdbool.h> // Header-file for boolean data-type.
int main() {  
    bool x=false;  // Declaration and initialization of boolean variable.
    if (x==true) {  // Conditional statement.    
        printf("The value of x is true");  
    } else {  
        printf("The value of x is false");  
    }
    
    return 0;  
    // Output: The value of x is false
}
Posted by: Guest on February-25-2022

Code answers related to "C"

Browse Popular Code Answers by Language