View Code of Problem 24

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

int main(void)
{
	int a,b,c;
	
while (scanf("%d %d %d", &a, &b, &c) != EOF)
{
		float s,
		float p;
	p = (a+b+c)/2.0;	
	s = sqrt(p*(p-a)*(p-b)*(p-c));
	
	printf("%.2f",s);
}
	return 0;
	
}
/*
Main.c: In function 'main':
Main.c:11:3: error: expected identifier or '(' before 'float'
   float p;
   ^~~~~
Main.c:12:2: error: 'p' undeclared (first use in this function)
  p = (a+b+c)/2.0;
  ^
Main.c:12:2: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 24