Here in this problem we are giving three option to the user and the user have to choose. the first choices Celsius To Fahrenheit, the second choice is Fahrenheit To Celsius and the Last one is Exit without testing any one of the queries.
Celsius to Fahrenheit Formula in C
Fahrenheit = ( Celsius * 9 / 5 ) + 32;
Fahrenheit to Celsius Formula in C
Celsius = ( Fahrenheit - 32 ) * 5 / 9;
Read: You can also check this program in C++ Click C++ Program For Converting Temperature Celsius Into Fahrenheit
Celsius to Fahrenheit Formula in C
Fahrenheit = ( Celsius * 9 / 5 ) + 32;
Fahrenheit to Celsius Formula in C
Celsius = ( Fahrenheit - 32 ) * 5 / 9;
Read: You can also check this program in C++ Click C++ Program For Converting Temperature Celsius Into Fahrenheit
C Program to Convert Celsius to Fahrenheit And Vice Versa
#include<stdio.h>
main() {
/* Visit - www.programmingwithbasics.com*/
float a, b, celsius, fahrenheit;
int x;
printf("Press 1 For Convert Fahrenheit To Celsius\n");
printf("Press 2 For Convert Celsius To Fahrenheit\n");
printf("\nEnter Your Choice: ");
scanf("%d", & x);
switch (x) {
case 1:
printf("\nEnter The Temperature in Fahrenheit: ");
scanf("%f", & a);
celsius = 5 * (a - 32) / 9;
printf("\n\nCelsius Temperature is: %f ", celsius);
break;
case 2:
printf("\nEnter The Temperature in Celsius: ");
scanf("%f", & b);
fahrenheit = ((9 * b) / 5) + 32;
printf("\n\nFahrenheit Temperature is: %f ", fahrenheit);
break;
default:
printf("\n\nWrong Choice.....Try Again!!!\n");
}
return (0);
}
Convert Celsius to Fahrenheit Output
Similar to Convert Celsius to Fahrenheit
- C Program to Display Fibonacci Series Using While Loop
- C Program To Delete Element From Array At Desired Or Specific Position
- C Program For Convert Octal Number to Decimal and Vice Versa Using Function
- C Program For Convert Binary to Octal and Vice Versa Using Function
- C Program to Display Prime Numbers Between Intervals Using Using Function
0 Comments: