#Include #Include: Double While
#Include #Include: Double While
#include <limits>
int main()
{
std::cout<<"This program is designed to test two linear equations. \n";
std::cout<<"In order to best solve the system, \n";
std::cout<<"equations will be in the form of a*x + b*y = c. \n";
std::cout<<"and d*x + e*y =f. \n";
std::cout<<"Please enter an integer for a, b, and c. \n";
double a, b, c, d, e, f;
while ((std::cout << "Enter a.")
&& !(std::cin >> a))
{
std::cout << "That's not a number ";
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
while ((std::cout << "Enter b.")
&& !(std::cin >> b))
{
std::cout << "That's not a number ";
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
while ((std::cout << "Enter c.")
&& !(std::cin >> c))
{
std::cout << "That's not a number ";
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
std::cout<<"Equation 1 is "<<a<<"x +"<<b<<"y ="<<c;
std::cout<<"Please enter an integer for d, e, and f. \n";
while ((std::cout << "Enter d.")
#include<stdio.h>
int main(){
int a[3][3],i,j;
int determinant=0;
printf("Enter the 9 elements of matrix: ");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
scanf("%d",&a[i][j]);
printf("\nThe First matrix is\n");
for(i=0;i<3;i++){
printf("\n");
for(j=0;j<3;j++)
printf("%d\t",a[i][j]);
}
for(i=0;i<3;i++)
determinant = determinant + (a[0][i]*(a[1]
[(i+1)%3]*a[2][(i+2)%3] - a[1][(i+2)%3]*a[2]
[(i+1)%3]));
printf("\nDeterminant of matrix is:
%d",determinant);
return 0;
}
return 0;
8
9
#include<stdio.h>
int main(){
int a[3][3],i,j;
long determinant;
return 0;
Sample output:
Enter the 9 elements of matrix: 1
2
3
4
5
6
7
8
9
The matrix is
1
4
7
2
5
8
3
6
9
cin>>d2;
cout<<"\Por favor introduzca el valor de g:";
cin>>g2;
cout<<"La ecuaciones formadas con los datos que han sido ingresados por
usted son \n\n";
if (b1>0){
cout<<"\n "<< a1 <<"x+"<<b1<<"y = "<< f1<< endl;
}
else {
cout<<"\n "<< a1 <<"x-"<<q<<"y = "<< f1<< endl;
}
if (d2>0){
cout<<"\n "<< c2 <<"x+"<<d2<<"y = "<< g2<< "\n\n\n} " <<endl;}
else {
cout<<"\n "<< c2 <<"x-"<<o<<"y = "<< g2<< "\n\n\n " << endl;}
m=(a1*d2)-(c2*b1);
if (m==0) {
cout<<"El sistema tiene infinitas soluciones"<< endl;
}
else if (m==0 && (n!=0 || p!=0)){
cout<<"El sistema no tiene solucin"<< endl;
}
cout<<"D