Question

use code blocks to write a code that a) solves linear, 2- variable simultaneous equation using...

use code blocks to write a code that

a) solves linear, 2- variable simultaneous equation using the elimination method.

Homework Answers

Answer #1

CODE FOR SOLVING SYSTEM OF LINEAR EQUATION IN TWO VARIABLE BY ELIMINATION METHOD

#include<stdio.h>

int main()

{

int i,j,k,n;

float A[20][20],c,x[10],sum=0.0;

printf("\nEnter the order of matrix: ");

scanf("%d",&n);

printf("\nEnter the elements of augmented matrix row-wise:\n\n");

for(i=1; i<=n; i++)

{

for(j=1; j<=(n+1); j++)

{

printf("A[%d][%d] : ", i,j);

scanf("%f",&A[i][j]);

}

}

for(j=1; j<=n; j++) /* loop for the generation of upper triangular matrix*/

{

for(i=1; i<=n; i++)

{

if(i>j)

{

c=A[i][j]/A[j][j];

for(k=1; k<=n+1; k++)

{

A[i][k]=A[i][k]-c*A[j][k];

}

}

}

}

x[n]=A[n][n+1]/A[n][n];

/* this lo…

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
6. For the non-linear differential equation: ??2 2 ??=? −(?+1) +1 (a) Use a computer algebra...
6. For the non-linear differential equation: ??2 2 ??=? −(?+1) +1 (a) Use a computer algebra system (CAS) to generate a slope field for the DE, and attach a printout of the result. (4 pts) (b) Analyze the slope field to determine the linear function ?(?) that solves the IVP when ?(0) = 1.
Section B.3 - Algebra - Simultaneous and Quadratic Equations Solve problems 1 and 2 using the...
Section B.3 - Algebra - Simultaneous and Quadratic Equations Solve problems 1 and 2 using the comparison, elimination, or substitution method. 1) x +y =2 2x -3y =5 2 ) 3x - 5y=5 7x + y = 75
Also write the time complexity Solve the non-linear recurrence equation using recurrence A(n) = 2A(n/2) +...
Also write the time complexity Solve the non-linear recurrence equation using recurrence A(n) = 2A(n/2) + n Solve the non-linear recurrence equation using Master’s theorem T (n) = 16T (n/4) + n
Using C++ code, write a program named q5.cpp to solve the equation 2n = 14.27 for...
Using C++ code, write a program named q5.cpp to solve the equation 2n = 14.27 for n.
Linear Regression Use linear regression to find the equation for the linear function that best fits...
Linear Regression Use linear regression to find the equation for the linear function that best fits this data. Round both numbers to two decimal places. Write your final answer in a form of an equation y=mx+by=mx+b x 1 2 3 4 5 6 y 98 122 156 176 213 219
The following situation can be modeled by a linear function. Write an equation for the linear...
The following situation can be modeled by a linear function. Write an equation for the linear function and use it to answer the given question. The price of a particular model car is $22,000 today and rises with time at a constant rate of $820 per year. How much will a new car cost in 3.4 years? Use an equation to model this situation where p is the price of a car in dollars and t is the time in...
10.16: Write a user-defined MATLAB function that solves a first-order ODE by applying the midpoint method...
10.16: Write a user-defined MATLAB function that solves a first-order ODE by applying the midpoint method (use the form of second-order Runge-Kutta method, Eqs(10.65),(10.66)). For function name and arguments use [x,y]=odeMIDPOINT(ODE,a,b,h,yINI). The input argument ODE is a name for the function that calculates dy/dx. It is a dummy name for the function that is imported into odeMIDPOINT. The arguments a and b define the domain of the solution, h is step size; yINI is initial value. The output arguments, x...
Use linear regression to find the equation for the linear function that best fits this data....
Use linear regression to find the equation for the linear function that best fits this data. Round both numbers to two decimal places. Write your final answer in a form of an equation y=mx+by=mx+b x 1 2 3 4 5 6 y 93 110 138 170 191 212   
Use linear regression to find the equation for the linear function that best fits this data....
Use linear regression to find the equation for the linear function that best fits this data. Round both numbers to two decimal places. Write your final answer in a form of an equation y = m x + b x 1 2 3 4 5 6 y 87 102 119 149 158 178
1. Given a matrix variable "mat", write code using for loops, if statements, etc. that will...
1. Given a matrix variable "mat", write code using for loops, if statements, etc. that will accomplish the same as the following: matsum = sum(mat') Please make sure to store the result in "matsum" and dont use sum. This is what I have so far but it keeps telling me is wrong.... % mat has been initialized for you: mat = randi([-100,100],randi([15,20]),randi([15,20])); % write your statements that accomplish the code above: [r c]=size(mat); for i=1:c matsum=0; for j=1:r matsum=matsum+mat(j,i); end...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT