Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
stochastic matrix
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
implicit none integer,parameter :: N = 3 real x1,x2,x3,x4,x5,x6,x7,x8,x9 integer, dimension (N , N) :: A real T print *, 'Enter values for 3x3 matrix :' read *, x1,x2,x3,x4,x5,x6,x7,x8,x9 A(1 ,:) = (/ x1, x2, x3 /) A(2 ,:) = (/ x4, x5, x6 /) A(3 ,:) = (/ x7, x8, x9 /) print *, sum(A,2) read *, T if ( T /= 1 .and. (x1< 0 .or. x2<0 .or. x3<0 .or. x4<0 .or. & x5<0 .or. x6<0 .or. x7<0 .or.x8<0 .or. x9<0)) then print *, 'This is not a stochastic matrix' else print *, 'This is a stochastic matrix' end if print *, 'A = ', A print *, 'Program finished..' end
Show compiler warnings
[
+
]
Show input
Compilation time: 0.13 sec, absolute running time: 10.33 sec, cpu time: 0 sec, memory peak: 0 Mb, absolute service time: 10,47 sec
edit mode
|
history
|
discussion