Hi,
I had this working before but now it doesn't seem to work. Whenever I type the number in it goes to the error message. It should print the message for each number.
Please help.
#include <stdio.h>
int barnum;
void main()
{
printf(“What is the reading on your barometer?”);
scanf(“%d”, barnum);
switch(number)
{ //START of case
case 1:
printf(“STORM: Wear something suitable for a storm!\n\n”);
break;
case 2:
printf(“RAIN: Wear a raincoat!\n\n”);
break;
case 3:
printf(“CHANGE: Wear a jacket and take an umbrella!\n\n”);
break;
case 4:
printf(“FAIR: Wear a jacket just in case!\n\n”);
break;
case 5:
printf(“DRY: You’ll be ok! Wear hardly any clothes at all!\n\n”);
break;
default:
printf(“You entered an invalid number you idiot!”);
} //END of case
}