delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/24/14:40:45

From: dabrownz AT mindspring DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: My second function doesn't work (stupid newbie question)
Date: Sun, 22 Jun 1997 03:47:16 GMT
Organization: MindSpring Enterprises
Lines: 39
Message-ID: <33ac9f87.20873600@news.mindspring.com>
Reply-To: dabrownz AT mindspring DOT com
NNTP-Posting-Host: ip166.pontiac.mi.pub-ip.psi.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

DJGPP keeps telling me that there is something wrong with my second
function.  I don't see why.  Please help, I'm a stupid newbie and I'll
appriciate any help (the answer is probably right under my nose)

Here is my source

-----------------------------------------------------

#include <stdio.h>

float computeSemiPer(float a, float b, float c);
float computeHero(float a, float b, float c, float s);

float main()
{
   float a, b, c, s, h;

a = 4;
b = 7;
c = 3;

s = computeSemiPer(a, b, c);

h = computeHero(a, b, c, s);

printf("\n%f\n", h);

   return 0;
}

float computeSemiPer(float a, float b, float c)
{
   return ((a + b + c)/2);
}

float computeHero(float a, float b, float c, float s)
{
   return (s(s - a)(s - b)(s - c));
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019