Hi all, so I'm stuck on a certain part of a program for my C class. Okay the program is supposed to query a user for a set number of entries for temperatures which is 26. It is supposed to take those temperatures and calculate the avg. at the end. Here's the part I'm lost on; There's 3 ranges for these temps to be specified; hot, cold, and pleasant. Besides returning the avg. number of all the temps. entered it also has to return how many hot, cold, and pleasant days were entered. I'm using a for loop and if statements to to gather the 26 entries and calculate the avg. But I'm lost on how to sum up how many hot, pleasant, and cold days and return the printf statement saying so. Should I use an array to do this? Thanks for any insight.
bwjones 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
bwjones 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
bwjones 0 Junior Poster in Training
bwjones 0 Junior Poster in Training
Dave Sinkula 2,398 long time no c Team Colleague
Aia 1,977 Nearly a Posting Maven
bwjones 0 Junior Poster in Training
Dave Sinkula 2,398 long time no c Team Colleague
bwjones 0 Junior Poster in Training
Drake -1 Newbie Poster
bwjones 0 Junior Poster in Training
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
bwjones 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.