Home / Computer / C Programming

C Programming

C Program Using Lagranges Interpolation Method

Write a C program Using Lagranges Interpolation Method #include<stdio.h> #include<conio.h> #include<math.h> #define MAX 10 int main() {     //clrscr();     int i,j,n;     float x[MAX],f[MAX],sum=0,pro,xp,fp;     printf(“Enter the number of data points:\n”);     printf(“\nn= “);     scanf(“%d”,&n);     for(i=0; i<n; i++)     {         printf(“\nInput the data points for x[%d]&f[%d]”,i,i); …

Read More »

C program to Implement Least Square Method

Write a C Program to Implement Least Square Method #include<stdio.h> #include<math.h> #include<conio.h> #define MAX 10 int main() {     int i,n;     float a0,a1;     float x[MAX],y[MAX],sumx=0.0,sumy=0.0,sumxy=0.0,sumxsq=0.0;     printf(“***Least square method***” );     printf(“\nInput the number of data points:”);     printf(“\nn=”);     scanf(“%d”,&n);     printf(“Enter the data sets one after …

Read More »

C Program to Find Root of a Function by Using Newton Raphson Method

Write a C Program to Find Root of a Function by Using Newton Raphson Method #include<stdio.h> #include<conio.h> #include<math.h> #define MAX 10 #define E 0.0001 #define f(x)  x*x*x-3*x-2 #define fd(x)  3*x*x-3 int main() {     //clrscr();     int count=0;     float x0,x1,fx,fdx;     printf(“\nEnter the initial value of x0\n”);     scanf(“%f”,&x0); …

Read More »