c - invalid type argument of unary '*' -
i'm week intro programming class, , i'm having trouble fixing what's supposed relatively simple code. keep getting invalid type argument of unary '*' error.
#include <stdio.h> #define pi 3.14159; int main() { float r; float area; scanf("%f", &r); area = pi * r * r; printf("area %f", area); return 0; }
could explain this, , how fix it?
#define pi 3.14159; ^
drop semicolon. leaving in, code expand to:
area = 3.14159; * r * r;
Comments
Post a Comment