the following is the code...
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float start_temp,stop_temp;
float step,F,C;
cout<<"start temperature:";
cin>>start_temp;
cout<<"stop temperature:";
cin>>stop_temp;
cout<<"step temperature:";
cin>>step;
float i=0;
cout<<setw(10)<<"celsius"<<setw(15)<<"fahrenheit"<<endl;
cout<<setw(25)<<"celsius"<<setw(15)<<"fahrenheit"<<endl;
for(i=start_temp;i<=stop_temp;i=i+step)
{
C=(5.0/9.0)*(i-32);
F=32+(9.0/5.0)*i;
cout<<setprecision(2);
cout.setf(ios::fixed);
cout<<setw(10)<<C<<setw(10)<<i<<setw(10)<<F<<endl;
}
}
and the output for the above code is:
start temperature: 0
stop temperature: 11
step temperature: 1.1
-17.78 0.00 32.00
-17.17 1.10 33.98
-16.56 2.20 35.96
-15.94 3.30 37.94
-15.33 4.40 39.92
-14.72 5.50 41.90
-14.11 6.60 43.88
-13.50 7.70 45.86
-12.89 8.80 47.84
-12.28 9.90 49.82
-11.67 11.00 51.80
but i am not able to print the last line of output.i.e.,-11.67 11.00 51.80
i dont know why it is not printing the last line of output..