View Code of Problem 26

#include<stdio.h>
main()
{	
  int F,C;
  scanf("%d",&F);
  (float)C=5/9*(F-32);
  printf("%.2f",C);
}
/*
Main.c:2:1: warning: return type defaults to 'int'
 main()
 ^
Main.c: In function 'main':
Main.c:6:11: error: lvalue required as left operand of assignment
   (float)C=5/9*(F-32);
           ^
Main.c:7:3: warning: format '%f' expects argument of type 'double', but argument 2 has type 'int' [-Wformat=]
   printf("%.2f",C);
   ^
*/

Double click to view unformatted code.


Back to problem 26