#include<iostream> #include<math.h> using namespace std; int main() { //variable
ID: 3615277 • Letter: #
Question
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
//variables
double fahrenheit[5],celsius[5];
int count = 0;
//calculation
for (count = 0; count<=4; count= count + 1)
{
cout<<"enter temperature in Fahrenheit"<<(count+1)<<endl;
cin>>fahrenheit[count];
}
cout<<endl;
//Formula to convert from Fahrenheit to Celsius: (5/9)*(degF-32).
for (count = 0; count<5; count= count + 1)
{
celsius[count]=(5.0/9.0)*(fahrenheit[count]-32);
}
cout<<"____________Temp_____________ ";
cout<<" Fahrrenheit. Celsius. ";
count=0;
while(count<=4)
{
cout<<fahrenheit[count]<<" | "<<celsius[count]<<" ";
count=count+1;
}
system("pause");
}
Explanation / Answer
for (count= 0; count<=4; count = count + 1)
{
cout<<"entertemperature in Fahrenheit "<<(count+1)<<endl;
cin>>fahrenheit[count];
}
After above code , the value of count=4;
SO, you must to reset i.e count=0;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.