So I am seriously stuck with a C program that I have to write for class. Unfortunaltely I just heard about this site and its extremely last minute, its due tomorrow. I tried to get help otherwise but that was not successful. This program is dealing with loops. It needs to count and print the number of hot days (high temperature 85 or higher), the number of pleasant days (high temperature 60-84), and the number of cold days (high temperatures less than 60). It also needs to print min, max, and avg. Also, we are reading the info from an input file. It compiles fine, and I have used the examples that have been given to me as well as my book. As i said, i know its last minute but any help would be greatly appreciated.
#include <stdio.h>
int main (void)
{
int counter=0, counterhot=0, counterpleasant=0,
countercold=0, total = 0, num=0, temp=0;
int min, max;
float average=0;
scanf("%d",&min);
total += min;
counter++;
while((scanf("%d",&num)) == 1){
total =+ num;
counter++;
if (num < min)
min = num;
}
scanf("%d", &max);
total += max;
counter++;
while((scanf("%d",&num)) == 1){
total =+ num;
counter++;
if (num > max)
max = num;
if (temp >84)
counterhot++;
printf("The number of hot days = %d\n", counterhot);
if (temp < 85 && temp > 59)
counterpleasant++;
printf("The number of pleasant days =%d\n",
counterpleasant);
if (temp < 60)
countercold++;
printf("The number of cold days = %d\n", countercold);
average = total/counter;
printf("%d", temp);
printf("You entered %d temperatures\n", counter);
printf("The total = %d\n", total);
printf("The average temperature = %f\n", average);
printf("Maximum = %d\n", max);
printf("Minimum = %d\n", min);
return 0;
}