📄 shiyan2.c
字号:
#include<stdio.h>
#include<math.h>
#include<conio.h>
#include<stdio.h>
#include<math.h>
#include<conio.h>
float f(float x)
{
return exp(x)-3*x*x;
}
float fd(float x)
{
return exp(x)-6*x;
}
int main(void)
{
float x0=4.0,x=4.0;
do
{
x0=x;
x=x0-f(x0)/fd(x0);//迭代公式求近似根;
}while(fabs(x-x0)>1e-4);
printf("the asymtomatic root is %f ",x0);
getch();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -