So here's the code
#include<stdio.h>
int main()
{
int choice;
float f,c;
printf("Enter the option no.\n");
printf("1.Fahrenheit to Celcius\n");
printf("2.Celcius to Fahrenheit\n");
printf("choice : ");
scanf("%d",choice);
switch(choice)
{
case 1 :
{
printf("Enter the temperature in °F : ");
scanf("%f",f);
c=(f-32)*5/9;
printf("The temperature in °C is %f",c);
break;
}
case 2 :
{
printf("Enter the temperature in °C : ");
scanf("%f",c);
f=9/5*c+32;
printf("The temperature in °F is %f",f);
break;
}
default :
{
printf("Invalid option.\n");
}
}
printf("Program ended\n");
return 0;
}
And this is the output
proot info: vpid 1: terminated with signal 11
