Строка 17: «sumXY» переименован в символ другого типа
Строка 20: несовместимые типы при возврате типа «float (*) (float, float)», но ожидалось «float»
как решить эту ошибку?
#include <stdio.h>
#include<math.h>
#include<stdlib.h>
float sumX, sumY, sumXY, sumsqX, xy, sum, n, b, a;
float a1, a2, a3, a4, a5, b1, b2, b3, b4, b5, c1, c2, c3, c4, c5, d1, d2, d3, d4, d5;
float a6, a7, a8, b6, b7, b8, c6, c7, c8, d6, d7, d8;
float sumf(float a, float b, float c, float m, float n, float e, float q, float z) {
sum = a + b + c + m + n + e + q + z;
return sum;
}
float sumXY(float p, float q) {
sumXY = p * q;
return sumXY;
}
int main()
{
printf("Enter the values of n:\n\n");
scanf("%f", &n);
sumX = 0;
printf("Enter the values of X:\n\n");
scanf("%f", &a1);
scanf("%f", &a2);
scanf("%f", &a3);
scanf("%f", &a4);
scanf("%f", &a5);
scanf("%f", &a6);
scanf("%f", &a7);
scanf("%f", &a8);
sumX = sumf(a1, a2, a3, a4, a5, a6, a7, a8);
sumY = 0;
printf("Enter the values of Y:\n\n");
scanf("%f", &b1);
scanf("%f", &b2);
scanf("%f", &b3);
scanf("%f", &b4);
scanf("%f", &b5);
scanf("%f", &b6);
scanf("%f", &b7);
scanf("%f", &b8);
sumY = sumf(b1, b2, b3, b4, b5, b6, b7, b8);
c1 = sumXY(a1, a1);
c2 = sumXY(a2, a2);
c3 = sumXY(a3, a3);
c4 = sumXY(a4, a4);
c5 = sumXY(a5, a5);
c6 = sumXY(a6, a6);
c7 = sumXY(a7, a7);
c8 = sumXY(a8, a8);
sumsqX = sumf(c1, c2, c3, c4, c5, c6, c7, c8);
d1 = sumXY(a1, b1);
d2 = sumXY(a2, b2);
d3 = sumXY(a3, b3);
d4 = sumXY(a4, b4);
d5 = sumXY(a5, b5);
d6 = sumXY(a6, b6);
d7 = sumXY(a7, b7);
d8 = sumXY(a8, b8);
xy = sumf(d1, d2, d3, d4, d5, d6, d7, d8);
printf("\t-----------------------------------------------------\n");
printf("\t\t\t*****Regression Table****\n");
printf("\t\t\t.....................\n");
printf("\n\tX\t\tY\tX^2\t\tXY\t\t\n");
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", a1, b1, c1, d1);
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", a2, b2, c2, d2);
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", a3, b3, c3, d3);
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", a4, b4, c4, d4);
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", a5, b5, c5, d5);
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", a6, b6, c6, d6);
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", a7, b7, c7, d7);
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", a8, b8, c8, d8);
printf("\t=======================================================\n");
printf("\n\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\n", sumX, sumY, sumsqX, xy);
printf("\t=======================================================\n\n");
b = (sumXY(n, xy) - sumXY(sumX, sumY)) / (sumXY(n, sumsqX) - pow(sumX, 2));
a = (sumY / n) - sumXY(b, sumX) / n;
printf("The regression Co-Efficient is :\t%.2f\n\n", b);
printf("The regression constant is :\t%.2f\n\n", a);
}