Answer to Question #225869 in C++ for Ulando

Question #225869

Write a program to convert Fahrenheit to Celsius.the formula for the conversion is follows:

Celsius (5/9)*(Fahrenheit-32)



1
Expert's answer
2021-08-13T16:12:58-0400
using namespace std;
#include <omp.h>
#include <stdio.h>

int main() 
{
    float Temp_in_deg,Temp_in_F;
	int Choice=0,Flag=1;
	
	while(Flag)
	{
		cout<<"\n\n\nSelect -> Press 1 for Deg. to Farenhite Conversion";
		cout<<"\nSelect -> Press 2 for Farenhite to Deg. Conversion";
		cout<<"\nSelect -> Press 0 to quit";
		cout<<"\nEnter Choice = "; cin>>Choice;
		if(Choice ==0) exit(0);
		
		if(Choice ==1)	
		{
			cout<<"\n\nEnter Temp. in deg. C = "; cin>>Temp_in_deg;
			Temp_in_F = ((9*Temp_in_deg)/5) + 32;
			cout<<"\n"<<Temp_in_deg<<" deg. C = "<<Temp_in_F<<" deg. F";
		}
		
		if(Choice == 2)
		{
			cout<<"\n\nEnter Temp. in deg. F = "; cin>>Temp_in_F;
			Temp_in_deg = (5*(Temp_in_F - 32))/9;
			cout<<"\n"<<Temp_in_F<<" deg. F = "<<Temp_in_deg<<" deg. C";
		}
	}
}




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS