1.
#include
#include
int main()
{
float x1, xn, h;
float a = 4, b = 7;
printf("Введите x1, xn, h:\n");
scanf("%f",&x1);
scanf("%f",&xn);
scanf("%f",&h);
for (float x=x1; x<=xn; x +=h)<br> printf("x = %.2f y = %.5f\n",x,b*x*sqrt(1+log(x)));
return 0;
}
2.
#include
#include
int main()
{
float x1, xn, h, x;
float a = 4, b = 7;
printf("Введите x1, xn, h:\n");
scanf("%f",&x1);
scanf("%f",&xn);
scanf("%f",&h);
x = x1;
while (x<=xn){<br> printf("x = %.2f y = %.5f\n",x,b*x*sqrt(1+log(x)));
x += h;
}
return 0;
}
3.
#include
#include
int main()
{
float x1, xn, h, x;
float a = 4, b = 7;
printf("Введите x1, xn, h:\n");
scanf("%f",&x1);
scanf("%f",&xn);
scanf("%f",&h);
x = x1;
do {
printf("x = %.2f y = %.5f\n",x,b*x*sqrt(1+log(x)));
x += h;
}
while (x<=xn);<br> return 0;
}
Пример:
Введите x1, xn, h:
2
5
0.1
x = 2.00 y = 18.21694
x = 2.10 y = 19.40142
x = 2.20 y = 20.59491
...
x = 4.90 y = 55.19244
x = 5.00 y = 56.53810