“ METODE NUMERIK ”
Tampilan FLOWCHART :
START
i = 0 ; i < n , ++ i
Xi , Yi
i = 0 ; i < n , ++ i
Pembilang = 1
Y
j = 0 ; j < n , ++ j T
i=j
j = 0 ; j < n , ++ j
Y
i=j T
T
Penyebut = penybut (x – xj)
i = 0 ; i < n , ++ i
𝑃𝑒𝑚𝑏𝑖𝑙𝑎𝑛𝑔
Li = 𝑃𝑒𝑛𝑦𝑒𝑏𝑢𝑡
y=0
i = 0 ; i < n , ++ i
y = y + Li yi
Printf y
Stop
Tampilan source code program
#include<stdio.h>
main()
float x[10],y[10],pembilang,penyebut,L[10],Y=0,X;
int i,j,n;
scanf("%d",&n);
for(i=0;i<n;++i)
scanf("%f",&x[i]);
scanf("%f",&y[i]);
scanf("%f",&X);
for(i=0;i<n;++i)
pembilang=1;
for(j=0;j<n;++j)
if(i==j)
continue;
pembilang*=(X-x[j]);
penyebut=1;
for(j=0;j<n;++j)
if(i==j)
continue;
penyebut*=x[i]-x[j];
L[i]=pembilang/penyebut;
for(i=0;i<n;++i)
Y=Y+L[i]*y[i];
}
Tampilan Output program di code block