Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_04 SIMPSON'S ONE THIRD(3(I))
PROGRAM SIMPSONS_ONE_THIRD IMPLICIT NONE REAL :: F,DX,A=0.0,B=1.0,N=100,X,S,C INTEGER :: I DX=(B-A)/N S=0 DO I=0,N X=A+I*DX !PRINT *,X IF (X==A .OR. X==B) THEN C=1 ELSEIF (MODULO(I,2)==0) THEN C=2 ELSEIF (MODULO(I,2)==1) THEN C=4 END IF S=S+(DX/3.0)*C*F(X) PRINT *, S END DO PRINT *, S END PROGRAM REAL FUNCTION F(X) IMPLICIT NONE REAL :: X F=(X**2)*EXP(X) END FUNCTION
run
|
edit
|
history
|
help
0
A_01 QN:3
IF GO TO
Dynamical Memory Allocation fortran
A_01 NEWTON_RM(B(III))
Characteristics polynomial
Practice secant
Ghhhb
Currency conversion
divisibility rule
A_03 MODIFIED EULER METHOD