Back To C++ Flow of Control Index
//program to convert fahrenheit temp to celsius and vice versa using switch statement #include
#include
void main() { int choice; double temp,conv; clrscr(); cout<<"\n1. fahrenheit to celsius"; cout<<"\n2. celsius to fahrenheit"; cout<<"\nenter your choice 1,2"; cin>>choice; switch(choice) { case 1: cout<<"\nenter temperature in fahrenheit"; cin>>temp; conv=(temp-32)/1.8; cout<<"\ntemperature in celsius is "<
>temp; conv=(1.8*temp)+32; cout<<"\ntemperature in fahrenheit is "<