I wrote some lines of following code.
if (c=='R') res = 4/5 * t;
else if (c=='F') res = (9/5 * t) + 32;
else if (c=='K') res = t + 273;
scanf("%s",&c);has a big chance to cause out-of-range access, which invokes undefined behavior. Use
%s) to read only one character.
printf("%.2f",&res);will invoke undefined behavior by passing data having wrong type to
&) to print data having type
float, which will automatically converted to
doublein variable-length arguments)
res = 4/5 * tand
res = (9/5 * t) + 32may not do what you want because
9/5are integer divisions, in which remainders are truncated. Try using
res = 4.f/5 * tand
res = (9.f/5 * t) + 32
scanf()s are successful and the data read is valid in order not to invoke undefined behavior by using values of uninitialized variables having automatic-storage duration, which are indeterminate.