/* A simple if statement */
#include <stdio.h>
#define THRESHOLD 20
int
main (void)
{
int temp;
printf ("What is the current temperature? ");
scanf ("%d", &temp);
printf ("------------------------------------\n");
//this if statement contains a true and a false branch
//with a compound statement in each branch
if (temp >= THRESHOLD)
{
printf ("The temperature is %d degrees. \n", temp);
printf ("It is quite warm. \n");
}
else
{
printf ("The temperature is %d degrees. \n", temp);
printf ("It is quite cool. \n");
}
return (0);
}