source code in c program for curve fitting

5
DIT-FRM-32(REV.NO.00) Appx- ‘B’ DIT UNIVEERSITY LABORATORY MANUAL PRACTICAL INSTUCTION SHEET EXPERIMENT TITLE: Root findings or curve fitting experiments: Writing and validation of c program EXPERIMENT NO: 7 ISSUE NO. ISSUE DATE: 3/1/2015 REV. NO.: REV. DATE: PAGE: DEPT: MECHANICAL LABORATORY: CAD LAB SEMESTER: 6 Source Code in C Program for Curve Fitting – Linear: #include<stdio.h> #include<conio.h> #include<math.h> int main() { int n,i,x[20],y[20],sumx=0,sumy=0,sumxy=0,sumx2=0; float a,b; printf("\n C program for Linear Curve Fitting \n "); printf("\n Enter the value of number of terms n:"); scanf("%d",&n); printf("\n Enter the values of x:\n"); for(i=0;i<=n-1;i++) { scanf(" %d",&x[i]);

Upload: erpriyeranjan

Post on 25-Sep-2015

235 views

Category:

Documents


0 download

DESCRIPTION

source code

TRANSCRIPT

DIT-FRM-32(REV.NO.00) Appx- BDIT UNIVEERSITYLABORATORY MANUAL

PRACTICAL INSTUCTION SHEET

EXPERIMENT TITLE: Root findings or curve fitting experiments: Writing and validation of c program

EXPERIMENT NO: 7ISSUE NO.ISSUE DATE: 3/1/2015

REV. NO.:REV. DATE:PAGE:

DEPT: MECHANICALLABORATORY: CAD LABSEMESTER: 6

Source Code in C Program for Curve Fitting Linear:#include#include#includeint main(){int n,i,x[20],y[20],sumx=0,sumy=0,sumxy=0,sumx2=0;float a,b;printf("\n C program for Linear Curve Fitting \n ");printf("\n Enter the value of number of terms n:");scanf("%d",&n);printf("\n Enter the values of x:\n");for(i=0;i