c++
Write a function called temperatures() 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) until 0 is entered. Calculate the average of temperatures and return the average of the temperature to the main function.
Answers
Answered by
0
Answer:
bdbdndndbdbdndbfnfjdjdjdj
Explanation:
helllo
Answered by
0
Answer:
#include<iostream>
using namespace std;
#include<conio.h>
int temp(int n);
int main()
{
int a,n;
cout<<"ent the number of days\n";
cin>>n;
a=temp(n);
cout<<"\navg of temp ="<<a;
}
int temp(int n)
{
int i=0,s=0;
int t[n];
cout<<"\nent the tempeature of :"<<n<<"days\n";
for(i=0;i<n;i++)
{
cin>>t[i];
}
int h=0,m=0,l=0;
for(i=0;i<n;i++)
{
if(t[i]>=85)
h++ ;
else if((t[i]>64)&&(t[i]<=84))
m++;
else
l++;
s=s+t[i];
}
cout<<"number of hot days = "<<h;
cout<<"\nnumber of normal days = "<<m;
cout<<"\nnumber of low temp days = "<<l;
return s/n;
}
Explanation:
Output is attached look at that.
HOPE IT HELPS YOU
DO FOLLOW FOR MORE PROGRAMS
MARK AS BRAINLIEST
Attachments:
Similar questions