/* Laboratory Assignment 4 Problem 2 Name: Roll No: */ /* REPLACE ALL UNDERSCORES ( _ ) WITH APPROPRIATE WORDS */ #include #include /* Linear Regression y = m * x + c */ main() { float m; float c; float Sumx = 0.0; float Sumxx = 0.0; float Sumy = 0.0; float Sumyy = 0.0; float Sumxy = 0.0; float xdata[100]; float ydata[100]; int i; int n; printf("Input the number of data points --> "); scanf("%d",&n); i = 0; while ( ______ ) { printf("%d out of %d : ",i,n); scanf("%f%f",___,_____); i++ ; } i = 0; /* Other quantities like Sumx etc are initialized in the declarations */ while ( i < n ) { Sumx = Sumx + xdata[i]; Sumy = Sumy + ydata[i]; Sumxx = ___________ Sumxy = __________ Sumyy = __________ i++; } m = (n*Sumxy - Sumx * Sumy)/(n*Sumxx - Sumx*Sumx); c = (Sumy*Sumxx - Sumx * Sumxy)/(n*Sumxx - Sumx*Sumx); printf("m = %f\nc = %f\n",m,c); /* WRITE CODE FOR PRINTING THE TABLE. */ }