Fahrenheit to Celsius Table
Given three values - Start Fahrenheit Value (S), End Fahrenheit value (E) and Step Size (W), you need to convert all Fahrenheit values from Start to End at the gap of W, into their corresponding Celsius values and print the table.
#include<iostream>
using namespace std;
int main(){
/* Read input as specified in the question.
* Print output as specified in the question.
*/
//Fertocen
int s,e,w,cel;
cin>>s>>e>>w;
/* float cel,far;
cin>>far;
cel=(far-32)*0.5555;
cout<<cel;*/
for (int i=s;i<=e;i=i+w){
cel=(i-32)/1.8;
printf("%d %d\n",i,cel);
}
}
Comments
Post a Comment