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
I need Programmer to extracting data Project Description: Programmer role A skilled programmer is required to build a standalone module to extract, parse and store in data

NopCommerce v3.10 - Content Page Creation, Product Import and Site Customization Project Description: I have an existing website with about 800 products and we could like to


Project Description: I am seeking some automated trading software for the given strategy, I am using Omnesys Nest trader Step 1: Buy one share at current market price (ex:

Question: (a) Give four benefits of ASP.NET Web Controls. (b) List and explain any five properties of the ValidationSummary control. (c) Multiple Web Form controls ca

What Is The Difference Between ViewState and SessionState? View State persist the values of controls of certain page in the client (browser) when post back operation done. When

PhotoHandler add-on to display file names Project Description: I want a website with a photo gallery using PhotoHandler. I need the code added/ modified to display the image

What is serialization, how it works in .NET? Serialization is when you persist the state of an object to a storage medium so an exact copy can be re-created at a later stage. S

I need help in Web application that will run stand alone in IIS (MS SQL) 2 activities / Tasks Code web user management module (create user, assign license, simple authorizati

About us in a nutshell: We are a young start-up that trade a refreshing product in the field of enterprise software and develops with the latest technologies. We love to partner wi