#include<iostream>
using namespace std;
int main(){
int temps[]={34,45,42,49,24,28,39,43,50,21,25,18,48,36,20};
int n=15,low,high;
//reading low and high
cout<<"Enter low and high temperature: ";
cin>>low>>high;
int count=0;
//iterating through the array and checking how many are between low and high
for(int i=0;i<n;i++){
if(temps[i]>=low && temps[i]<=high)
count++;
}
cout<<"There are "<<count<<" temperatures between "<<low<<" and "<<high<<endl;
}
NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.
Please Like and Support me as it helps me a lot
Get Answers For Free
Most questions answered within 1 hours.