Write a program that finds the temperature, as an integer , that is the same in
ID: 674967 • Letter: W
Question
Write a program that finds the temperature, as an integer , that is the same in both Celsius and Fahrenheit. The formula to convert from Celsius to Fahrenheit is: Fahrenheit = 32 + (nine fifths) times Celsius.
Your program should create two integer variables for the temperature in Celsius and Fahrenheit. Initialize the temperature to 100 degrees Celsius. In a loop, decrement the Celsius value and compute the corresponding temperature in Fahrenheit until the two values are the same
written in c++ programming, the simplest way
Explanation / Answer
#include<iostream.h>
#include<conio.h>
void main()
{
int c=100,f;
for(c=100;c>=0;c--)
{
f=32+(9/5)*c;
if(c==f)
{
cout<<c<<endl;
break;
}
}
getch();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.