Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
simpsonova for
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
!gfortran, gcc version 5.4.0 20160609 program simpson h=0.1 !korak z=0.0 !integral funkcije suman=0.0 !suma neparnih tocaka sumap=0.0 !suma parnih tocaka a=1.0 !prva tocka intervala b=1.8 !krajnja tocka intervala x=a+h !prva neparna tocka y=a+2*h !prva parna tocka n=(0.8/h)/2 !broj neparnih iova m=(0.8/h)/2-1 !broj parnih iova !forumla z=(b-a)/(3n)((f(a)+4*suma f(neparnih iova)+2*suma(parnih iova)+f(b)) do i=1,n !suma neparnih iova suman=suman+cosh(x) x=x+2*h !iduca neparna tocka intervala end do do j=1,m !suma parnih iova sumap=sumap+cosh(y) y=y+2*h !iduca parna tocka intervala end do z=((b-a)/(3*(m+n+1)))*(cosh(a)+4*suman+2*sumap+cosh(b)) print *, z end program simpson
Show compiler warnings
[
+
]
Show input
Compilation time: 0.12 sec, absolute running time: 0.08 sec, cpu time: 0.01 sec, memory peak: 3 Mb, absolute service time: 0,22 sec
edit mode
|
history
|
discussion