delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/01/18:02:39

From: David Jenkins <me AT jenkinsdavid DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: working out circumference help
Date: Mon, 1 Sep 1997 18:07:48 +0100
Organization: None
Distribution: world
Message-ID: <lHiWIAAkZvC0EwtA@jenkinsdavid.demon.co.uk>
References: <01bcb6e0$041efb00$LocalHost AT rossa>
NNTP-Posting-Host: jenkinsdavid.demon.co.uk
MIME-Version: 1.0
Lines: 41
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <01bcb6e0$041efb00$LocalHost AT rossa>, Ross Boast
<Rossa AT btinternet DOT com> writes
>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;
What does the (a,2) do?? I haven't come across this before.


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

If your printf outputted a variable it might work. :)

printf ("The circumference of the circle is %i\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.
>
>

-- 
http://www.jenkinsdavid.demon.co.uk for C programmers.
David Jenkins

- Raw text -


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