write a function to print hot or cold weather depending on the users enter in C
// write a function to print hot or cold weather depending on the users enter
#include <stdio.h>
void main()
{
int temperature;
printf("Input days temperature: ");
scanf("%d", &temperature);
if(temperature<0)
printf("Freezing weather.\n");
else if(temperature<20)
printf("Very cold weather.\n");
else if(temperature<30)
printf("cold weather.\n");
else
printf("its very hot.\n");
}
Comments
Post a Comment