Program for solution of linear equations - c# program, DOT NET Programming

Assignment Help:

Program for Solution of Linear Equations - C# Program

Hello, I've been trying so many codes for this but those codes didn't work well. Please write a Program for solving Linear Equation in c#.


Related Discussions:- Program for solution of linear equations - c# program

Yuy, Ask queyuyuystion #Minimum 100 words accepted#

Ask queyuyuystion #Minimum 100 words accepted#

Define an array, Define an array. An array is explained as a homogeneou...

Define an array. An array is explained as a homogeneous collection of elements, stored at contiguous memory locations, which can be referred by the similar variable name. All t

Different transaction levels in sql server, What are different transaction ...

What are different transaction levels in SQL SERVER? The Transaction Isolation level decides how is the one process isolated from theother process. Using the transaction levels

What is the role of the jit compiler in .net framework, What is the role of...

What is the role of the JIT compiler in .NET Framework? The JIT compiler is an significant element of CLR, which loads MSIL on target machines for execution. The MSIL is stored

Dispose method in .net, What is Dispose method in .NET? The .NET provid...

What is Dispose method in .NET? The .NET provides "Finalize" method in which we can clean up our resources. But relying on this is not always better so the best is to implement

Explain the diffrent type of literals in c#, Explain the diffrent type of l...

Explain the diffrent type of literals in c# The different types of literals in C# are: Boolean literals - Refers to the True and False literals that map to the true and fals

Define importance of vitamin c, Define importance of Vitamin c Freezing...

Define importance of Vitamin c Freezing preserves vegetable and nutrients to a great extent. Vitamin A and β-Carotene are well preserved in spinach, peas and beans, or are mode

I need asp developer, ASP Developer- We are needed to hire an ASP develo...

ASP Developer- We are needed to hire an ASP developer for some urgent work. He needs to add a new page to an already prepared site; the page is already completed in HTML. He jus

Creating dynamic web pages, As you have probably realized by now, Web pages...

As you have probably realized by now, Web pages are much more useful when they are dynamic. In Internet terminology, the word dynamic means several things. Primarily, it refers to

Describe the disconnected architecture of ado.net, Describe the disconnecte...

Describe the disconnected architecture of ADO.NET's data access model. ADO.NET maintains a disconnected database access model, which means, the application never remains linked

Aana

2/11/2013 7:59:14 AM

Hope this code will help you in finding solution of your problem.

Program:

using System;  

class LinearEquations

{

  public static void Main()

 {

   int response;

   float a,b,c,d,m,n, temp;

   double x1,x2;  

  EnterNewValuesAgain:  

  Console.WriteLine(""); // Blank Line

  Console.WriteLine(" ** Linear Equation **** ");

  Console.WriteLine(""); // Blank Line

   // Reading the value of a

  Console.Write("Enter the value of a : ");

  a = float.Parse(Console.ReadLine());                         // Reading the value of b

  Console.Write("Enter the value of b : ");

  b = float.Parse(Console.ReadLine());                        // Reading the value of c

  Console.Write("Enter the value of c : ");

  c = float.Parse(Console.ReadLine());                         // Reading the value of d

  Console.Write("Enter the value of d : ");

  d = float.Parse(Console.ReadLine());  

     temp = a*d - b*c;  

   if (temp == 0)

   {

   Console.WriteLine(""); // Blank Line

   Console.WriteLine("The denominator equals to zero (0); Cannot proceed

further ...");

   Console.Write("Do You want to enter new values (1 For Yes / 0 For No) ?

");

   response = int.Parse(Console.ReadLine());

  if (response == 0) 

   {

     goto Exit;

   }

    else

   {

     goto EnterNewValuesAgain;

   }   }

    else

   {    // Reading the value of m

   Console.Write("Enter the value of m : ");

   m = float.Parse(Console.ReadLine());

Alice

2/11/2013 8:03:08 AM

I think the above code is incomplete. please try to use this after the above code.

   Console.Write("Enter the value of n : ");

   n = float.Parse(Console.ReadLine());

   x1 = ((m*d) + (b*n))/((a*d) - (c*b));

   x2 = ((n*a) + (m*c))/((a*d) - (c*b));

   Console.WriteLine(""); // Blank Line

   Console.WriteLine("Value of x1 = " + x1);

   Console.WriteLine("Value of x2 = " + x2);

   Console.WriteLine(""); // Blank Line

   Console.Write("Do You want to enter new values (1 For Yes / 0 For No) ?

");

   response = int.Parse(Console.ReadLine());

    if (response == 0) 

   {

     goto Exit;

   }

    else

   {

     goto EnterNewValuesAgain;

   }

  }

  Exit:

   Console.WriteLine(""); // Blank Line

   Console.WriteLine("Thank You For using this small program ... :)");

  Console.ReadLine();}}

Write Your Message!

Captcha
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