Cs201-Assignment 2 Solution Spring 2021
Code
#include <iostream>
#include <conio.h>
using namespace std;
int ShowMatrix()
{
int row=2, column=2;
int matrix[2][2] = { {8, -4} , {-6, 2} };
cout<<"The matrix is:"<<endl;
for(int i=0; i<row; ++i) {
for(int j=0; j<column; ++j)
cout<<matrix[j]<<" ";
cout<<endl;
}
}
int showTranspose ( )
{
int transpose[2][2], row=2, column=2, i, j;
int matrix[2][2] = { {8, -4} , {-6, 2} };
cout<<endl;
for(i=0; i<row; ++i)
for(j=0; j<column; ++j) {
transpose[j] = matrix[j];
}
cout<<"The transpose of the matrix is:"<<endl;
for(i=0; i<column; ++i) {
for(j=0; j<row; ++j)
cout<<transpose[j]<<" ";
cout<<endl;
}
}
int calculateDeterminant()
{
int determMatrix[2][2], determinant;
int matrix[2][2] = { {8, -4} , {-6, 2} };
determinant = ((matrix[0][0] * matrix[1][1]) -
(matrix[0][1] * matrix[1][0]));
cout << "\nThe Determinant of 2 * 2 Matrix = " << determinant;
}
int showAdjoint()
{
int ch,A2[2][2] = {{8,-4},{-6,2}},AD2[2][2],C2[2][2];
//Calculating cofactors of a matrix of order 2x2
C2[0][0]=A2[1][1]; C2[0][1]=-A2[1][0]; C2[1][0]=-A2[0][1]; C2[1][1]=A2[0][0];
//calculating adjoint of the matrix of order 2x2
AD2[0][0]=C2[0][0]; AD2[0][1]=C2[1][0]; AD2[1][0]=C2[0][1]; AD2[1][1]=C2[1][1];
cout<<"\n\nAdjoint of A is :- \n\n";
cout<<"|\t"<<AD2[0][0]<<"\t"<<AD2[0][1]<<"\t|\n|\t"<<AD2[1][0]<<"\t"<<AD2[1][1]<<"\t|\n";
}
int main()
{
int choice = 0;
cout<<"************* "<<endl;
cout<<"vu all in one subscribe my channel "<<endl;
cout<<"************* "<<endl;
cout<<"Enter your choice "<<endl;
cout<<"Press 1 to display the matrix and its transpose"<<endl;
cout<< "Press 2 to find adjoint and determinant of the matrix"<<endl;
cout<<"Press any other key to exit.";
cin>>choice;
if (choice ==1)
{
ShowMatrix();
showTranspose ( );
}
else if (choice == 2)
{
showAdjoint();
calculateDeterminant();
}
else
system("pause");
}
PURPOSE OF VUPORTAL865.COM
Virtual university is Providing quality of Education in Pakistan and Overseas too. Thousands of Students getting quality education. Virtual University of Pakistan is first university In Pakistan that providing online education to everyone in Pakistan. in this university online Education is easy and Affordable for everyone.
Most students find trouble scheduling time for their assignments since the research work is a time-consuming activity. Even so, others find trouble writing their assignment due to a lack of writing skills. Such students need to worry no more since there are several available online assignment help websites. As such, this article provides the top 10 most trusted online assignment help websites that ensure that students get the best out of their assignment help services.
We take your assignments with paramount importance as happy students are our primary goal. Our services are the most affordable, trustworthy and cover a lot of subjects.
Assignment Submission Instruction
Please read the following
instructions carefully before submitting the assignment:
It should be clear that your assignment will not get 0 if:
Ø The assignment is submitted after the due date.
Ø The submitted assignment file is corrupt or does not open.
Ø Assignment is copied from any where like any student or from internet.
How to Submitted Assignment:
Ø Download a question File of the Assignments on LMS.
Ø Solve a question and make a file own words.
Ø Save an Answer file in which extension who Instructor Told.
Ø Go to the LMS and Click the Books Code which you can make a solution file.
Ø Go to the Submitted Option and Click the Chose File Button.
Ø File chose where you can Save the File.
Ø After chose the File last step click the Submitted Option.
For Paid Assignments Solution
Contact us on WhatsApp
MR Ammar(Developer) +923235459470
MR Atif (Blogger) +923086278790
MR Umar (WordPress Expert) +923053183537
Mam Farah(Assignment Expert) +994409089591
FOR ALL ASSIGNMENTS VISIT THE WEBSITE BELOW
CLICK HERE
Comments
Post a Comment