|
|
səhifə | 5/5 | tarix | 10.04.2023 | ölçüsü | 255,07 Kb. | | #95591 |
| интегралBu səhifədəki naviqasiya:
- n=10, a=2, b=3.5, EPS=0.1; ga: h=(b-a)/n; s = (funk(a)+funk(b))/2; s=0; for(int i=1; i {
- n=n-10; h=(b-a)/n; for (int i=0; i { x=a+h*i; cout
- include using namespace std; int a, n, i; float z, EPS, h, s, x, b, c; float funk(float y) {
- n=10, a=2, b=3.5, EPS=0.1; ga: h=(b-a)/n; s = (funk(a)+funk(b)); c = 1, x = a; for(int i=1; i {
- gc: if (abs(s-z)>EPS) goto gb; n=n-10; h=(b-a)/n; for (int i=0; i { x=a+h*i;
#include
using namespace std;
int a, n, i;
float z, EPS, h, s, x, b;
float funk(float y)
{
return (1/(sqrt(5+4*y-y*y)));
}
int main()
{
cout << "Aniq integralni to'gri trapetsiya usulida xisoblash dasturi : \n";
n=10, a=2, b=3.5, EPS=0.1;
ga: h=(b-a)/n;
s = (funk(a)+funk(b))/2;
s=0;
for(int i=1; i<=n-1; ++i)
{
x=a+h*i; s=s+funk(x);
}
s*=h;
if (n!=10) goto gc;
gb: n=n+10;
z=s; goto ga;
gc: if (abs(s-z)>EPS) goto gb;
n=n-10; h=(b-a)/n;
for (int i=0; i
{
x=a+h*i;
cout<
}
cout<<"integralning qiymati : s="<< s ;
return 0;
}
Aniq integralni Simpson usulida yechishning C++ dagi kodi
#include
using namespace std;
int a, n, i;
float z, EPS, h, s, x, b, c;
float funk(float y)
{
return (1/(sqrt(5+4*y-y*y)));
}
int main()
{
cout << "Aniq integralni simpson usulida xisoblash dasturi : \n";
n=10, a=2, b=3.5, EPS=0.1;
ga: h=(b-a)/n;
s = (funk(a)+funk(b));
c = 1, x = a;
for(int i=1; i<=n; ++i)
{
x=a+h; s=s+(c+3)*funk(x);
c -= c;
}
s*=h/3;
if (n!=10) goto gc;
gb: n=n+10;
z=s; goto ga;
gc: if (abs(s-z)>EPS) goto gb;
n=n-10; h=(b-a)/n;
for (int i=0; i
{
x=a+h*i;
cout<
}
cout<<"integralning qiymati : s="<< s ;
return 0;
}
Dostları ilə paylaş: |
|
|