Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_04 SIMPSON'S RULE (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 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
Practice 2(I) second time
problem_2
A_01 NEWTON_R_M(B(I))
Practice 3
Gauss for
Fortran Homework 1
A_04 SIMPSON'S RULE(3(I))
Fib series
problem_2
lcm and gcd using prime factorization