Conversion (fahrenheit to celsius)

#include
using namespace std;
int main() {
int min,max,step;
cin>>min>>max>>step;
for(int i=0;i<=max;i++)
{
i=istep;
int C=5
(i-32)/9;
cout<<i<<" "<<C<<endl;
}
return 0;
}
why my code not work?

Hello @AjayRRJ,

You are iterating the loop over wrong range.

  1. i should start from min instead of 0.
  2. i should be incremented by step.

Hope, this would help.
Give a like, if you are satisfied.

1 Like