Student Portfolio >> Index >> Coding >> Exercise 20
#include <iostream.h>
int main()
float temp;
do
{
cout<<"\nEnter a tempature between -40 and 50 (Past These Boundaries to Repeat): \n";
cin >>temp;
}
while (temp <-40 || temp >50);
if (temp >=20) cout << "\n It Was Hot \n"; else if (temp >=6) cout << "\n It Was Warm \n"; else if (temp>=-5) cout << "\n It Was Cold \n"; else if (temp <-5) cout << "\n It Was Freezing \n"; else if cout<< "\n Invalid entry \n"; } return 0; } << back Forward >> |
Copyright 2005 Kerstin Kegel