Я продолжаю получать те же две синтаксические ошибки, и я не могу понять, почему. может кто-то пожалуйста, помогите мне понять, что это не так и почему я получаю эти ошибки синтаксисаошибка C2059: синтаксическая ошибка: '='
shipping.c<61> : error C2059: syntax error : '='
shipping.c<70> : error C2059: syntax error : '='
Это код, что мои ошибки в:
/* НЕ КОПИРОВАТЬ */
#include <stdio.h>
#include <math.h>
#define PI = 3.14159
#define PACKING_DENSITY = 0.59
/* прототип функции */
double bearing(double radius, double diameter);
double actual_weight(double density, double pound);
int shipping_weight(double actualWeight, double roundingFix);
double cost_per_box(int shippingWeight, double shippingRate);
int
main(void)
{
/* дает имена переменных */
double width;
double height;
double depth;
double diameter;
double density;
double shippingRate;
double costPerBox;
double radius;
/* вызова для переменных */
printf("Enter width %d\n");
scanf("%lf", &width);
printf("Enter height %d\n");
scanf("%lf", &height);
printf("Enter depth %d\n");
scanf("%lf", &depth);
printf("Enter diameter %d\n");
scanf("%lf", &diameter);
printf("Enter density %d\n");
scanf("%lf", &density);
printf("Enter shipping rate %d\n");
scanf("%lf", &shippingRate);
/* Возвращение ответы */
printf("Bearings = %f\n", bearing);
printf("Shipping weight = %f\n", shipping_weight);
printf("Shipping cost per box = %f\n", cost_per_box);
return(0);
}
/* расчеты подшипников */
double
bearing(double radius, double diameter)
{
radius = diameter/2;
return((4/3) * pow(radius, 3) *PI);
}
/* расчеты для фактического веса */
double
actual_weight(double density, double pound)
{
pound = 2.20464; /* <=conversion */
return(density * PACKING_DENSITY * pound);
}
/* расчеты для перевозки * Вес/
int
shipping_weight(double actualWeight, double roundingFix)
{
roundingFix = .9;
return(actualWeight + roundingFix);
}
/* расчеты по стоимости в коробке */
double
cost_per_box(int shippingWeight, double shippingRate)
{
return(shippingWeight * shippingRate);
}
Вы не ставите «=» для определения макросов. Просто сделайте, '#define PI 3.14159' и woosh .... все ошибки исчезли. – Abhineet