View Code of Problem 24

#include <stdio.h>
#include <math.h>

int main()
{


        
        while((scanf("%d %d %d",&a,&b,&c))!=EOF)
        {
                  int t;
                  float p,s;
        	  int a,b,c;
                  p=(a+b+c)/2.0;
                  s=sqrt(p*(p-a)*(p-b)*(p-c));
                  printf("%.2f\n",s);
                
        }
}

/*
Main.c: In function 'main':
Main.c:9:34: error: 'a' undeclared (first use in this function)
         while((scanf("%d %d %d",&a,&b,&c))!=EOF)
                                  ^
Main.c:9:34: note: each undeclared identifier is reported only once for each function it appears in
Main.c:9:37: error: 'b' undeclared (first use in this function)
         while((scanf("%d %d %d",&a,&b,&c))!=EOF)
                                     ^
Main.c:9:40: error: 'c' undeclared (first use in this function)
         while((scanf("%d %d %d",&a,&b,&c))!=EOF)
                                        ^
Main.c:11:23: warning: unused variable 't' [-Wunused-variable]
                   int t;
                       ^
*/

Double click to view unformatted code.


Back to problem 24