#include int main(void) { int temp; printf("What is the temperature? "); scanf("%d", &temp); /* Example 1: branch with only 1 statement to excute */ if (temp >= 100) printf("The water is boiling!\n"); /* Example2: ERROR if assignment operator is used, then condition is always true! */ /* The correct condition should use double equality: "if (temp == 1000) " */ if (temp = 1000) printf("ERROR: Since condition uses assignment, this is printed\n"); printf("But this statement is always executed.\n\n"); /* Example 3: branch with several statements to execute. we have to use curved braces to show a code block that should be executed together if condition holds */ if (temp >= 100) { /* use opening curved brace to indicate we begin a compound statement */ printf("WARNING: The water is boiling!\n"); printf("Turn off the heat!\n"); } /* use closing curved brace to indicate we end a compound statement */ return(0); }