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

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#.

Posted Date: 2/11/2013 7:55:43 AM | Location : United States





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());

Posted by Aana | Posted Date: 2/11/2013 7:59:14 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();}}

Posted by Alice | Posted Date: 2/11/2013 8:03:08 AM


Related Discussions:- Program for solution of linear equations - c# program, Assignment Help, Ask Question on Program for solution of linear equations - c# program, Get Answer, Expert's Help, Program for solution of linear equations - c# program Discussions

Write discussion on Program for solution of linear equations - c# program
Your posts are moderated
Related Questions
Asp.net expert and simple html I am not new to the industry. I am seeking a long term asp.net developer to build and maintain a volleyball player management website. We would

Net project Project Description: We want to make .net project Microsoft Active Directory, PMS Lync 2010 - 2013 databases creating a license key for their SW generati

Calculate Standard Deviation - C# Program Hello i am unable to find the code for Calculate Standard Deviation in c#. Can anybody please provide me the assignment help?

What are the different levels Of IIS isolation?  The IIS consist of 3 level of isolation as shown below:- LOW (IIS process):- In this type of isolation the main IIS proc

Project Description: I need to unlock software or make a similar kind of software. It is presently installed in my PC and I will provide you installation files if needed. It wil

Need Experienced Outlook (Microsoft Office) developer Your required skills: (1) A developer at heart, one that knows how to prepare modular, well-designed and clean code, (2) va

What are the difference b/w System.String and System.StringBuilder classes? The System.StringBuilder can have mutable string where a variety of operations can be performed whil

Briefly explain the characteristics of reference-type variables that are supported in the C# programming language. The variables that are based on reference types keeps referen

What do you mean by data encapsulation? Data encapsulation is a method of binding data and code in single unit known as object and hiding all the implementation details of a cl

Prepare datamodel, API and more Project Description: Dear all, we would like you to prepare database and an API which can be used in the shopping cart (checkout and delivery