My code is working perfectly fine but not being accepted. Why?
https://ide.codingblocks.com/s/52718
Conversion(Fahrenheit to celsius assignment )
Thanks. But, just asking, why did you opt while loop and not for loop are there any disadvantages?
Hey Divyam, there is no problem with the for loop its just that there is no need to use outer while loop in your code. You can update your main() just by commenting outer while loop as shown in code snippet below it will work fine.
int main() {
int minf, maxf,step;
cin>>minf>>maxf>>step;
int i=minf;
int temp=0;
// while(minf>=0 && minf<100 && maxf<500 && maxf>minf && step >= 0)
// {
for( ; i<=maxf ; i=i+step)
{
temp= (int)((5.0/9)*(i-32));
cout<< i<<" ";
cout << temp << endl ;
}
// }
return 0;
}