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

  Finding whether two machines are equivalent

Consider the problem of finding whether two of these machines are equivalent. Formulate this problem as the language, and illustrate that it is undecidable.

  Continue to keep a journal

Continue to keep a journal of your activities and experience of using SAP. Include a copy of your full journal as an appendix to the reflective essay.

  Type of information of microsoft useful inprofessional life

What kind of information on the site do you find to be valuable to you? What kind of information about Microsoft Word do you find to be useful in your personal or professional life? Explain.

  Describe primary uses of networking for business

Describe at least 2 of the primary uses of networking for businesses. Discuss how you might match appropriate networking technologies.

  Cores on computer systems

Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency,

  Describe valid advice for naming variables

Which of the given is valid advice for naming variables? To save typing, make most variable names one or two letters. to avoid conflict with names which others are using , utilize unusual or unpronounceable names.

  Find the percentage of swap operations in instruction mix

If implementation of instruction in hardware will increase th clock period of single-instruction implementation by 10%, what percentage of swap operations in instruction mix would suggest implementing it in hardware?

  Given a 3 millisecond seek time

Given a 3 millisecond seek time for a disk drive and assuming that once you reach the starting track you will write the file as contiguous sectors, how long will it take to write a 1 megabyte file? The disk rotates at 7200 rpm and each sector hold 1 ..

  Write a program that reads the data in the file and displays

Write a program that reads the data in the file and displays the car number, miles driven, gallons used and the miles per gallon for each car.

  Explaining ethical issues related to it

Ethics is "a set of principles of right conduct". Main ethical issues related to IT are accuracy, privacy,  property (including intellectual property), and accessibility to information.

  Calculate access time when there is cache miss

Calculate the access time when there is cache miss? Suppose that cache waits until line has been fetched from main memory and then re-executes for a hit.

  Channel along which bits transfer circuitry of computer

Within circuitry of computer, each channel along which bits transfer, called a(n) ____, permits the several devices both inside and attached to system unit to communicate with each other.

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