错误:在以'rad'开头的行中'='标记之前的预期表达式

时间:2013-10-18 10:29:52

标签: expression message token

/ 输入部分 /

printf("Enter the value for a: ");
scanf("%d", &a);

printf("Enter the value for b: ");
scanf("%d", &b);

printf("Enter the value for theta: ");
scanf("%d", &theta);

/ 计算部分 /

rad = (theta * ( PI/180 ));
c = sqrt( pow(a,2) + pow(b,2) - (2 * a * b * cos(rad)));
per = (a + b + c);
area = (a * b * sin(rad)/2);

/ 输出部分 /

printf("The perimeter equals: %f\n", per);
printf("The area equals: %f\n", area);

如何修复此错误消息?

0 个答案:

没有答案