using namespace std;
cout<<"\nEnter the order of the matrix:\n"; //Get the order of the square matrix
double a[n][n],b[n],c[n],k,eps,y; //declare arrays and other variables to be used
cout<<"\nEnter the elements of matrix row-wise:\n";
cout<<"\nEnter the initial values of the eigen-vector:\n";
cout<<"\nEnter the accuracy desired:\n";
k=b; //Assign some initial value to the eigen value, 'k'
for (i=0;ik?abs(c[i]):k; //Find the largest element of c and assign it to k where k is the eigen value
for (i=0;ieps); //Check if the error in eigen value is within the tolerance limit
cout<<"The eigen-value is: "<
PhD researcher at Friedrich-Schiller University Jena, Germany. I'm a physicist specializing in theoretical, computational and experimental condensed matter physics. I like to develop Physics related apps and softwares from time to time. Can code in most of the popular languages. Like to share my knowledge in Physics and applications using this Blog and a YouTube channel.