Hey guy,
Im an engineering student who just started a programing class concerning C.
Our first assignment was to write a basic program to calculate the area of a circle by the given guidlines. I took the program step by step, but the gcc command came back with three errors. Im sure its just a beginners mistake. Ive posted the code, and the errors. Any help would be greatly appreciated.
-Cliff
Code:
/* The purpose of this program is to calculate the area and circumference
of a circle using Pi as a constant.
Written by: Clifton
Date: July 4th
*/
#include <stdio.h>
#define PI 3.1416
int main (void)
{
// Local Declarations
float circ;
float area;
float radius;
// Statements
printf("\nPlease enter the value of the radius: ");
scanf("%f", &radius);
cric = 2 * PI *radius;
area = 2 *radius *radius;
printf("\nRadius is : %10.2f", radius);
printf("\nCircumference is : %10.2f", circ);
printf("\nArea is : %10.2f", area);
return 0;
} //main
-------------
And the Errors
-bash-3.00$ gcc program1.c
program1.c: In function `main':
program1.c:21: error: `cric' undeclared (first use in this function)
program1.c:21: error: (Each undeclared identifier is reported only once
program1.c:21: error: for each function it appears in.)