Make a c program using cramers rule using 3 variables and eq

Assignment Help Basic Computer Science
Reference no: EM13165190

make a C program using cramers rule using 3 variables and 3 equations. I need help why the third variable says it isnt initialized and allow the the determinents to be calculated. also i need help making a menu allowing the user to make a start the program and enter the new variables or to exit the program.

 

This is what i have so far:

#include <stdio.h>

#include<stdlib.h>

int main (void)
{
    int r,c;
    double a[3][3],b[3];
    double x1a, x2a, x3a, x1, x2, x3, d;
    printf("\n Solving for 3 Equations- 3 unknowns\n");

    for (r=0; r<3; r++)
    {
        for (c=0; c<3;c++)
        {
            printf("Enter a [%d][%d]:" ,r,c);
            scanf_s("%lf", &a[r][c]);
        }
d=(a[0][0]*a[1][1]*a[2][2])+(a[0][1]*a[1][2]*a[2][0]) +(a[0][2]*a[1][0]*a[2][1])-(a[0][2]*a[1][1]*a[2][0])-(a[0][0]*a[1][2]*a[2][1])-(a[0][1]*a[1][0]*a[2][2]);

x1a=(b[0]*a[1][1]*a[2][2])+(a[0][1]*a[1][2]*b[2])+(a[0][2]*b[1]*a[2][1])-(a[0][2]*a[1][1]*b[2])-(b[0]*a[1][2]*a[2][1])-(a[0][1]*b[1]*a[2][2]);

x2a=(a[0][0]*b[1]*a[2][2])+(b[0]*a[1][2]*a[2][0]) +(a[0][2]*a[1][0]*b[2])-(a[0][2]*b[1]*a[2][0])-(a[0][0]*a[1][2]*b[2])-(b[0]*a[1][0]*a[2][2]);

x3a=(a[0][0]*a[1][1]*b[2])+(a[0][1]*b[1]*a[2][0])+(b[0]*a[1][0]*a[2][1])-(b[0]*a[1][1]*a[2][0])-(a[0][0]*b[1]*a[2][1])-(a[0][1]*a[1][0]*b[2]);

x1=x1a/d; x2=x2a/d; x3=x3a/d;

printf("\n X1=%lf, X2=%lf, X3=%lf\n",x1,x2,x3);
system("pause");
return 0;
    }}

 

 

Reference no: EM13165190

Questions Cloud

Compute price and quantity materials variances : Compute price, and quantity materials variances for the Tile Company for March. Indicate amount ($) and favorable (F) or unfavorable (U) effects. Price variance
Explain what is the final temperature of the water : What is the final temperature of the water and pieces of metal?
Determine ending inventory under perpetual inventory system : Determine the ending inventory under a perpetual inventory system using (1) FIFO, (2) moving-average cost, and (3) LIFO. the ending inventory under a perpetual inventory system.
Consider the molar mass of nh : You prepared a 0.250 M solution by diluting 8.45(+-0.04)mL of 28.0(+-0.5)mL wt.%NH3 (density=0.899(+-0.003)g/mL up to 500.0(+-0.2)mL. Find the uncertainty in 0.250 M.
Make a c program using cramers rule using 3 variables and eq : make a C program using cramers rule using 3 variables and 3 equations. I need help why the third variable says it isnt initialized and allow the the determinents to be calculated. also i need help making a menu allowing the user to make a start the p..
Topics: user interface, input validation, computer security : Topics: user interface, input validation, computer security, i/o processing, storage & retrievalAssignment: Write a program that will simulate a basic registration/login process for a standard application or website.Menu ItemsCreate a profileAsk the ..
Calculate the molality, molarity : An aqueous antifreeze solution is 40.0% ethylene glycol (C2H6O2) by mass. The density of the solution is 1.05 g/cm3. Calculate the molality, molarity, and mole fraction of the ethylene glycol.
Read the file a line at a time : Write the modified text file with the same name as the original file, but preprended with 'new_'. For instance, if the input filename was 'data.txt', the output filename would be 'new_data.txt'.
What is the molecular weight of the hormone : An aqueous solution containing 21.6 mg of vasopressin in 100.0 mL of solution has an osmotic pressure at 25.0 oC of 3.70 mmHg. What is the molecular weight of the hormone?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explaining multicategory case a set of samples

In multicategory case a set of samples is said to be linearly separable if there exists linear machine which can classify them all correctly.

  College or organization is considering a new project

Suppose your college or organization is considering a new project that would involve developing an information system that would allow all employees and students/customers to access and maintain their own human

  Aspects of negotiation will point out it is proceeding well

What aspects of negotiation will point out it is proceeding well or poorly? What will tell you that it is time to arrange further meeting? What signs will you utilize to decide when change in negotiators is necessary?

  Create a set of instructions

Provide a private address to be used for the AS and a public address to be used to connect to an ISP router connected to a border router.Create a set of instructions for the lab that would have students create a basic configuration and test connecti..

  Bob''s encryption company

Suppose Bob's encryption company produces two machines, A and B, both of this are supposed to be implemen- tations of RSA using the same modulus n = pq for some unknown primes p and q

  Use of visitor pattern to supply additional functionality

Rather than use the Visitor pattern to supply additional functionality. Give the details and compare the advantages and disadvantages of this approach when compared to the Visitor pattern.

  Explaining mandatory access control implementation

How are Novell AppArmor and the Red Hat "targeted" SELinux policy similar? Is either a true Mandatory Access Control implementation. If not, explain why.

  Explain can capabilities protect against all trojan horses

Can capabilities protect against all Trojan horses? Either show that they can or describe a Trojan horse process that C-Lists cannot protect against.

  Weighted probabilities for x86 processors

Create a procedure that receives a value N between 0 to 100. When the procedure is called, there should be a probability of N/100 that it clears the Zero flag. Write a program that asks the user to enter a probability value 0 to 100.

  Determine the maximum period obtainable from lcg

Determine the maximum period obtainable from following LCG? Xn+1 = aXn (mod 24). What must be the value of a?

  Details on any information

Details on any information/software that might not be submitted for evaluation due to NDA requirements or security/privacy concerns.

  Shannon-fano-elias code or arithmetic code for symbols

The binary sequence s = 111111111000000111111111111111100001 = 1^9,0^6,1^16,0^4,1 was generated by a stationary two-state Markov chain with transition probabilities p1|0 = 2p0|1 = 0.2. a Shannon-Fano-Elias code or an arithmetic code for 3-bit symb..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd