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

  Create logic circuit which will decode dtmf-like keypad

Create the logic circuit which will decode the DTMF-like keypad. The keypad comprises of 16 keys, numbered 0 to 9, *, #, A, B, C, and D.

  How technology contributed to modern theatre

How has technology contributed to modern theatre? If you have seen play or musical recently, analyze how technology contributed to its production.

  Finding content of ac and memory word at specified address

What are the content of the AC and the memory word at address 103 when the computer halts.

  Is igital divide likely to last more than one generation

In developed countries and some less developed countries, computers and Internet access are available in schools. Is the "Digital Divide" likely to last more than one generation?

  Java application that prints the table

Create a JAVA application that prints the table using the sqrt () method in the Math class. Use a for loop to produce the output results.

  Explaining data-tlb hit and data-cache hit

Upon a load instruction, event "data-TLB hit" followed by "data-cache hit" is the most probable to occur among four possibilities of Cartesian product.

  Determine the date in opening the letter from same file

if /home/jenny/draft and /home/Alex/letter are relates to same file and the following sequence of events occurs, determine the date in opening the letter?

  Mechanism that one app uses

What is the mechanism that one app uses to signal to another app that its cooperation is requested to accomplish something.

  Deliver software to a schedule

You are asked by your manager to deliver software to a schedule that you know can only be met by asking your project team to work unpaid overtime.

  Each cycle in an instruction cycle

Suppose each cycle in an instruction cycle takes an average of 5 clock cycles. Determine the number of clock cycles needed to process 10 instructions without and with a pipeline

  How to solve performance problem of computer

Your friend recommends upgrading RAM to 256 MB to correct performance problems. Is there any other way to solve performance problem? Justify your answer.

  Explain us supreme court-s reaction bribery of internal

Explain what was U.S. Supreme Court's reaction to case where business executive was found guilty of aiding and abetting in bribery of Internal Revenue Service Agent.

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