Скачиваний:
25
Добавлен:
02.05.2014
Размер:
486 б
Скачать
//Lab 2_2_1
//Integral po formule tropecii
#include <STDIO.h>
#include <MATH.h>
#include <CONIO.h>
#define n 100
int i;
float a, b, h, x, s, sn, f[n];
main()
{
clrscr ();
a=0.2; b=10;
h=(b-a)/n;
f[1]=sqrt(pow((2+a),3))/(a*a);
f[100]=sqrt(pow((2+b),3))/(b*b);
for(i=1; i<n; i++)
         {
         x=(a+i*h);
         f[i]=sqrt(pow((2+x),3))/(x*x);
         sn+=f[i];
         }
s=(h/2)*(f[1]+f[100]+2*sn);
printf ("\nZnachenie integrala s=%f", s);
getch ();
}
Соседние файлы в папке Лабораторная работа 2