I wrote some lines of following code.
#include "stdio.h"
int main(){
float t,res;
char c;
scanf("%f",&t);
getchar();
scanf("%s",&c);
if (c=='R') res = 4/5 * t;
else if (c=='F') res = (9/5 * t) + 32;
else if (c=='K') res = t + 273;
printf("%.2f",&res);
return 0;
}
I have no idea why the output shown 0.00 when I give t = 25 and c = 'R'. The console looks like this.
25
R
0.00
Would any body give me an explanation?