C Program for Fixed Point / Iteration Method
HomeNumerical MethodFixed point/iteration method

C Program for Fixed Point / Iteration Method

Program #include<conio.h> #include<stdio.h> #include<math.h> #define f(x) ((5/x)+x)/2 #define e 0.0001 int main(vo...

Horner's Rule
C Program for Secant Method
C Program for Newton Raphson Method
Program

#include<conio.h>
#include<stdio.h>
#include<math.h>
#define f(x) ((5/x)+x)/2
#define e 0.0001
int main(void)
{
float x0,x1,f1 ;
int i=1;
clrscr();
printf("Using Fixed Point Method / Iterative Method to find root of x^2-5=0\n");
printf("Enter value for x0\n");
printf("x0: ");
scanf("%f",&x0);
printf("steps\tx0\tx1\n");
b:x1=f(x0);
printf("%d\t%.4f\t%.4f\n",i,x0,x1);
i++;
if(fabs((x1-x0)/x1)<=e)
{
printf("The root is %.4f",x1);
goto c;
}
else
{
x0=x1;
goto b;
}
c:
getch();

}

Output








How to solve using this method?
First you have to derive function from the given function to find root. Here x^2-5=0 function is used and have to find its root so ((5/x)+x)/2=0 function is derived.
Second insert value for x.
Third find value of function by substituting the value on derived equation and check for error criteria.
If not match the the resultant function value become x and repeat the same process i.e finding value of function.
If match print root.  
Name

Accident Alert,1,AI,2,Array,1,Aurdino,1,C,2,Computer Graphics,9,Data Science,3,Dataset,1,Decoratot,1,Django,1,ESP32,1,Fixed point/iteration method,1,Greater or smaller,1,html,1,Image Processing,1,JAVA,1,Javascript,22,Machine Learning,1,Matlab,3,Numerical Method,13,OOP,1,Other,3,PHP,1,Point operation,1,Python,11,Raspberry pi,1,Recommendation System,1,Regression,1,Reservation System,1,Robotics,1,Simulation,2,sine wave,1,String Handling Function,1,Web scrap,1,Webpage,1,
ltr
item
COMPUTER PROGRAMMING: C Program for Fixed Point / Iteration Method
C Program for Fixed Point / Iteration Method
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkqxz1_dQLHcKQDa_1g_XEmPjoz0-gOsFWFBJdtFxa7pitGsKrLTCQ1_RhrL8lBz6_s-od772lpeafPfPgPaRA0dPzQATxKZpjAoRZujjA-pepaBfWhyZdOVyUyqXbsx16vH9PNmRM7rSM/s320/Screenshot+%252842%2529.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkqxz1_dQLHcKQDa_1g_XEmPjoz0-gOsFWFBJdtFxa7pitGsKrLTCQ1_RhrL8lBz6_s-od772lpeafPfPgPaRA0dPzQATxKZpjAoRZujjA-pepaBfWhyZdOVyUyqXbsx16vH9PNmRM7rSM/s72-c/Screenshot+%252842%2529.png
COMPUTER PROGRAMMING
https://computerprogram4ru.blogspot.com/2016/07/c-program-for-fixed-point-iteration.html
https://computerprogram4ru.blogspot.com/
https://computerprogram4ru.blogspot.com/
https://computerprogram4ru.blogspot.com/2016/07/c-program-for-fixed-point-iteration.html
true
8672391763020279633
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy