Here is a sample of pseudo code which helps in calculating the quadratic equation in simple way:
We know famous equation (ax2 + bX+ c = 0)
First of all we have to ask user Enter the value for coefficient of X(square):
and enter the value for coefficient of X and finally value for constant. Then we store the value in some variable and execute the formula:
//Global Variables
decimal a=0;
decimal b = 0;
decimal c= 0;
{
a = Convert.Todecimal(textbox1.text);
b = Convert.Todecimal(textbox2.text);
c= Convert.ToDeciaml(textbox3.text);
}
//write the forumla
decimal result = (formula goes here//);
textbox4.text = result.ToString();
}
This is just an example of pseudo code which works in theory but never executes in practical. Note: in the formula, you need to use Math method and operators to execute further. I can help you to understand the logical flow of the program.
You can comment me if you want to get further free codes in C#. Thank you!
No comments:
Post a Comment