Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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
}
Source by www.scaler.com #
 
PREVIOUS NEXT
Tagged: #set #boolean
ADD COMMENT
Topic
Name
3+5 =