Listing Program

FORTRAN :

INTEGER PANG,KOEF(20),X(10),HASIL(20),DUM(20),TEMP
INTEGER KOEFNYA,X1,KDI,HAS(20)
INTEGER*4 DELTA1(10)
WRITE(*,'(24(/))')
WRITE(*,*)'INTERPOLASI'
WRITE(*,*)
WRITE(*,'(A,\)')'PANGKAT TERTINGGI :'
READ(*,'(I2)')PANG
DO 10 I=PANG+1,1,-1
WRITE(*,'(A,I2,A,\)')'KOEF X^',I-1,'='
READ(*,'(I3)')KOEF(I)
10 CONTINUE
WRITE(*,'(A,\)')'F(X)= '
DO 20 I=PANG+1,1,-1
WRITE(*,'(I3,A,I1,\)')KOEF(I),'X^',I-1
IF(I.GT.1) THEN
WRITE(*,'(A,\)')'+'
ENDIF
20 CONTINUE
WRITE(*,*)
WRITE(*,'(A,\)')'BANYAKNYA AKAR :'
READ(*,'(I2)')J
DO 31 K=1,J
HASIL(K)=0

WRITE(*,'(A,I2,A,\)')'AKAR[',K,']='
READ(*,'(I2)')X(K)
DO 30 I=PANG+1,1,-1
HASIL(K)=HASIL(K)+(KOEF(I)*X(K)**(I-1))
30 CONTINUE
31 CONTINUE
DO 40 I=1,J-1
DELTA1(I)=0

K=I+1
DELTA1(I)=HASIL(K)-HASIL(I)

40 CONTINUE
WRITE(*,*)'X

Y

DELTA1

'

WRITE(*,'(A,\)')'----------------------------------------'
WRITE(*,*)
DO 41 I=1,J-1
WRITE(*,'(I2,I10,I15)')X(I),HASIL(I),DELTA1(I)
41 CONTINUE
END

Sign up to vote on this title
UsefulNot useful