help with writing function that multiplys the radius
Just like to say hi to everybody and that umm this is basically my first semester of programming its been pretty fun and its always cool learning new things.
Teach wanted us to write a program that did a couple of things.
1. prompt the user for the radius in main *did that*
2. use this formula to find the diameter 2r (2 * radius)
3. use this formula to find the circumference 2pi r(2*pi*radius)
4. use this formula to find the circle pi rē (pi * r * r)
5. use a seperate function for each calculation and print the answers from main.
What I need help is figuring out how do I go about coding this program. Im stuck at part 2 because I dont know what to do next. here is my code.
Code:
/* The purpose of this program is to read in the radius and print out
the circle's diameter, circumference, and area */
#include <stdio.h>
#include <conio.h>
#define PI 3.14159
void main()
/* This function asks the user to type in a number for the radius of a circle */
{
printf("Please enter the radius of a circle: ");
scanf ("%d", &radius);
getch();
}
/* This function lists the diameter of the number inputed as the radius of the circle */
void function1(float diameter, float radius)
so for the 2nd function do I start off by writing the formula in ?