This is written in SSH Secure Shell
Code:
/* Homework Two- compute area and volume of sphere */
#include <stdio.h>
#include <math.h>
#define pi = 3.141593
main()
{
double Area, Radius, Volume, pi;
int r;
int k;
for(r=1; r<=1; r++);
for(k=10; k<=20; k++);
{
Radius=((k)*(.1));
Area=(pi*(Radius)*(Radius));
Volume=((4/3)*pi*(Radius)*(Radius)*(Radius));
printf("\n");
printf("Sphere (%2d)\tRadius = %4.1f\tArea = %7.3f\tVolume = %7.3f",r,Radius,Are
a,Volume);
}
}
~
~
~
I'm getting parse errors, they are as follows...
:Hw2.c: In function `main':
Hw2.c:7: parse error before '=' token
Hw2.c:14: parse error before '=' token
Hw2.c:14: parse error before ')' token
Hw2.c:15: parse error before '=' token
Hw2.c:15: parse error before ')' token
Any help would be appreciated, thanks
-Steve