delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/03/06:10:26

Date: Tue, 2 Sep 1997 14:30:06 -0500 (CDT)
From: Andrew Deren <aderen AT eecs DOT uic DOT edu>
To: Ross Boast <Rossa AT btinternet DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: working out circumference help
In-Reply-To: <01bcb6e0$041efb00$LocalHost@rossa>
Message-ID: <Pine.SUN.3.95.970902142813.961A-100000@s6b.eecs.uic.edu>
MIME-Version: 1.0

On 1 Sep 1997, Ross Boast wrote:

> 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);
use: scanf("%d", &a);

> b = (a,2) * PI;
b = (a*a)*PI;

> printf ("The circumference of the circle is %i\n\n");
printf("..... %d\n\n", b);


> 
> 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
> 


                        ,,,
                       (0 0)
   +-------------oOO----(_)-------------------+
   |                Andrew Deren              |  
   |             aderen AT eecs DOT uic DOT edu          |
   | www.eecs.uic.edu/~aderen/ader/main.html  |
   +-------------------------oOO--------------+
                       || ||
                      ooO Ooo
 


- Raw text -


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