Given temperature in °Celsius, we have to write a program to convert it in °F and print it on the screen.
To convert Celsius to Fahrenheit, we use the given formula:
°F=95°C+32
# Algorithm
- Input the temperature and store it in c
- Calculate the temperature in Fahrenheit using the above formula and store it in f
- Print f
#include <iostream> using namespace std; int main() { float celsius; cout << "Enter temperature in Celsius\n"; //inputting the temperature cin >> celsius; float f = (9 *celsius) / 5; //calculating the first part of the formula f += 32; //calculating the remaining part cout << "temperature in Fahrenheit:" << f; //printing the calculated }
1 Comments
eladrostda Jermaine Williamson https://marketplace.visualstudio.com/items?itemName=6femyocitsu.PuzzleQuest--Challenge-Of-The-Warlords-gratuita-2022
ReplyDeletestatinunas