delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/02/14:47:52

From: "Ross Boast" <Rossa AT btinternet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: working out circumference help
Date: 1 Sep 1997 14:10:51 GMT
Organization: BT Internet
Lines: 30
Message-ID: <01bcb6e0$041efb00$LocalHost@rossa>
NNTP-Posting-Host: host5-99-48-170.btinternet.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello!,
         Yep its me again and once again i need help (with djgpp that
is:).I'm trying to make a program which calculates the circumference of any
circle by inputing the radius (with which it times by 2 then by PI) and the
diameter (with which it just times by PI).Ihave included math.h which
enables me to use PI or M_PI but it doesn't work.Heres how it goes (i have
only got up to the radius bit as i didn't want to move on due to the fact
it didn't work) :

int radius(){
int a,b;
printf ("Please enter the radius of the circle : ");
scanf("%i", &a);
b = (a,2) * PI;
printf ("The circumference of the circle is %i\n\n");

I have tried it using floating numbers and tried it b = a * 2 * PI and
various other methods.I suppose its something simple that i haven't done or
a simple mistake, i just need someone to point it out for me.Once i
(hopefully) know whats wrong i hope to finish my program.If anyone has a
source file that uses mathematical functions and would be willing to share
it with me i would be grateful ;).

Thanks in advance.


-- 
Rossa :)
at
Rossa AT BTinternet DOT com

- Raw text -


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