title: Infix to Postfix, math function(sin), C
body: <p>how i can implement math function(sin) to my easy Infix to Postfix convertor?</p>
  
  <p>The code is from <a href="http://www.c-program-example.com/2011/10/c-program-for-infix-to-postfix.html" rel="nofollow">http://www.c-program-example.com/2011/10/c-program-for-infix-to-postfix.html</a></p>
  
  <p>Its possible implement for example sin?
  Start expresion will be for example sin(2+3), or sin(3)+3....</p>
  
  <p>Can you give me a example?</p>
  
  <p>Thank you verry much.</p>
  
  <pre><code>int pr(char elem) { /* Function for precedence */
   switch (elem) {
   case '#':
    return 0;
   case '(':
    return 1;
   case '+':
   case '-':
    return 2;
   case '*':
   case '/':
    return 3;
   }
  }
  
  main() { /* Main Program */
   char infx[50], pofx[50], ch, elem;
   int i = 0, k = 0;
   printf("\n\nRead the Infix Expression ? ");
   scanf("%s", infx);
   push('#');
   while ((ch = infx[i++]) != '\0') {
    if (ch == '(')
     push(ch);
    else if (isalnum(ch))
     pofx[k++] = ch;
    else if (ch == ')') {
     while (s[top] != '(')
      pofx[k++] = pop();
     elem = pop(); /* Remove ( */
    } else { /* Operator */
     while (pr(s[top]) &gt;= pr(ch))
      pofx[k++] = pop();
     push(ch);
    }
   }
  .
  </code></pre>
  
  <p>.
  .</p>
  
  <pre><code>}
  </code></pre>