Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
TraceMarrix
//g++ 7.4.0 //Trace : finding the sum of main diagonal elements //code is created by Rezaul Hoque on January 22,2021 //please contact at jewelmrh@yahoo.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <iostream> using namespace std; int main () { double a[3][3]={11,22,33,40,20,60,35,25,15}; cout <<"The matrix is:\n"; for (int i=0;i<3;i++) { for (int j= 0;j<3; j++) cout <<" "<<a[i][j]; cout <<endl; } double trace=0; for (int i=0;i<3;i++) { for (int j= 0;j<3; j++) if(i==j) trace += a[i][j]; } cout <<"The trace is "<<trace<<endl; return 0; }
run
|
edit
|
history
|
help
0
Zadanie Kolokwium_2011_z4
cppPyProperty
Wipro Problem 2: determine count
Q
cache_node.cc
Good morning
reverseKNode
Geometric Series
TwoANOVA
so