title: Formula and math expression parser algorithm
body: <p>I must write a program that able to parsing formula.
  It should work like this example below :</p>
  
  <p>Input : 5x + 7 ^ sin(z) / 2T + 44<br>
  Output : Enter value for x , z , t<br>
  Input : 2 , 1 ,2 <br>
  Output : the answer is : something <br></p>
  
  <hr>
  
  <p>It should support (+ , * , - , ^ , % , SIN , COS)
  <br>
  I did read <a href="http://en.wikipedia.org/wiki/Shunting_yard_algorithm" rel="nofollow">this</a> page about Shunting-yard algorithm</p>
  
  <p>And also I know how to convert Infix expression to postfix or prefix.<br>
  <b>It is my algorithm :</b>
  <br></p>
  
  <blockquote>
    <p>1 - Give the expression. <br>2 - If
    parentheses are balance go to step 3
    else show error go to step 1<br> 3 -
    Find all variables apart from (SIN ,
    COS) <br> 4 - Give variables from
    input<br> 5 - Replace variables<br> 6
    - Prefix the expression and calculate it<br> 7 - Display result in output
    and close program<br></p>
  </blockquote>
  
  <p>Is that right ? I want to implement it in C# <br>Please suggest me any note might be useful for me.</p>