1. ## plz help!

I'm having trouble with my school assignment. The program is suppose to ask to user to input some temperature values(which it does) then it is suppose to count the number of Hot Days (85 or <), Pleasant Days (65-84), and Cold Days (64 or >) wich it does also it also calculates the average of temperatures entered in by the user. What I can't figure out is how to print the values for Hot Days, Pleasant Days, and Cold Days. I would appreciate any help you can offer, hear is my code....

Code:
```/*Program to process a collection of daily high temperatures
Written by Janelle Shew
Adapted from various course handouts and book
February 2008
Language written in C (gcc target)*/

#include <stdio.h>

#define sentinel 00

int main(void)
{
int	 hot = 0,
pleasant = 0,
cold = 0,
sum = 0,
count,
temp;
double  average;

sum=0;
count=0;
printf("Enter temperature (00 to quit): ", sentinel);
scanf("%d", &temp);
while (temp != sentinel)
{  if (temp <= 59)
{ ++cold; }
else if (temp >= 60 && temp<= 84)
++pleasant;
else
++hot;
sum=sum+temp;
count++;
printf("Enter temperature (00 to quit): ", sentinel);
scanf("%d", &temp);
}
printf("%d Hot Days:\n", hot);
printf("%d Pleasant Days:\n", pleasant);
printf("%d Cold Days:\n", cold);
printf("%d", temp);
printf("There are %d total temperatures\n", count);
average=(double)sum/(double) count;
printf("\nAverage temperature is %8.2f\n", average);

return (0);
}```
This is what the output looks like:

Enter temperature (00 to quit):45
Enter temperature (00 to quit):34
Enter temperature (00 to quit):67
Enter temperature (00 to quit):87
Enter temperature (00 to quit):89
Enter temperature (00 to quit):95
Enter temperature (00 to quit):77
Enter temperature (00 to quit):39
Enter temperature (00 to quit):00
3 Hot Days:
2 Pleasant Days:
3 Cold Days:
There are 8 total temperatures

Average temperature is 66.62

2. It looks like it's functioning correctly.

printf("Enter temperature (00 to quit): ", sentinel); //sentinel is unneeded in this line. You don't actually print it here.

3. Search the forum. This exact question has been asked prior and solved.

4. The question that I'm looking for at this point hadn't been answered yet. Sorry if I was unclear. The program runs fine I however I just need the program to print the values of Hot days.

Meaning when the values are inputed by the user and the results show that

"2 Hot Days: "

I need the values of the Hot Days to print along side the Hot Days count. So that a user who entered Hot Days of 90 and 86...results will show like this....

"2 Hot Days: 90 86"

5. Perhaps you could store the tempuratures in a couple of linked lists, so that you can print the hot, fair, and cold days tempuratures out again after you calculate the average tempurature.

6. What happens if you enter 0 degrees and you don't want to quit?

7. Maybe op doesn't live in a place where it gets that cold.

8. Originally Posted by citizen
Maybe op doesn't live in a place where it gets that cold.
It is not so cold... if we are talking Fahrenheit and not Kelvin (I'm regular with Cilcius... so 0 is warm enough )