1234567891011121314151617181920212223242526272829303132333435363738
#include<stdio.h> void FtoC(double F) { // printf("%lf",(F - 32)*(.55)); printf("%lf",(F - 32)*(5/9)); } void CtoF(double C) { // printf("%lf",(C*1.8)+32); printf("%lf",(C*(5/9))+32); } int main() { printf("Press C ==> to Celsius to Fahrenheit\n"); printf("Press F ==> to Fahrenheit to Celsius\n\n"); char ch = getchar(); printf("Number: "); double s ; scanf("%lf",&s); if (ch == 'C') { CtoF(s); } else if (ch == 'F') { FtoC(s); } return 0; }
(float)5/(float)9
5.0/9.0