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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -