View Code of Problem 24

#include <stdio.h>
#include <string.h>
#include <math.h>
#define N 100
int main()
{
	int  a, b, c;
	float p,s;
	scanf_s("%d %d %d", &a, &b, &c);
	p = (a + b + c) / 2;
	s = sqrt(p * (p - a) * (p - b) * (p - c));
	printf("%.2f", s);

}
/*
Main.c: In function 'main':
Main.c:9:2: warning: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
  scanf_s("%d %d %d", &a, &b, &c);
  ^~~~~~~
  scanf
/usr/bin/ld: /tmp/cck9j11M.o: in function `main':
Main.c:(.text.startup+0x1d): undefined reference to `scanf_s'
collect2: error: ld returned 1 exit status
*/

Double click to view unformatted code.


Back to problem 24