Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
matrix calculator
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
//samuel ugochukwu nwutobo //matrix calculator //20 jun 2017 #include <iostream> #include <cmath> using namespace std; int main() { int det; int b1,b2,b3,b4,b5,b6,b7,b8,b9; int arr[3][3] { {2,3,-1}, {3,5,2}, {1,-2,-3}}; //uncomment if you want to us input stream /* for(int i =0;i <3;i++) { for(int j=0;j <3; j++) cin>>arr[i][j];} */ b1 =arr[0][0]; b2 =arr[0][1]; b3 =arr[0][2]; b4 =arr[1][0]; b5 =arr[1][1]; b6 =arr[1][2]; b7 =arr[2][0]; b8 =arr[2][1]; b9 =arr[2][2]; det = b1*((b5*b9)-(b6*b8))-b2*((b4*b9)-(b6*b7))+b3*((b4*b8)-(b5*b7)); cout<<"deteminat is: "<<det; }
g++
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.32 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0,46 sec
edit mode
|
history
|
discussion
deteminat is: 22