title: Converting a mathematical equation into a C++ code
body: <p>I have a homework in C++ Intro. and one of it said to convert the following mathematical equation into a C++ code: </p>
  
  <pre><code>x = 10π/(a+b) sin3C+ 3(ln a)(tan C)
  </code></pre>
  
  <p>where a,b, and C are user-input and C is in degrees.</p>
  
  <p>I've tried it myself and had end up with this:</p>
  
  <pre><code>float x,y,z,a,b,C;
  
  cout&lt;&lt; "Input the a-value: ";
  cin&gt;&gt; a;
  
  cout&lt;&lt; "\nInput the b-value: ";
  cin&gt;&gt; b;
  
  cout&lt;&lt; "\nInput the C-value: ";
  cin&gt;&gt; C;
  C = C*3.1416/180;
  
  x = (10*3.1416/a+b)*pow(sin(C),3)+3*log(a)*tan(C);
  cout&lt;&lt; "\n The value of x is " &lt;&lt; x;
  </code></pre>
  
  <p>I've tried a=5,b=10, and C=15 and the result of x is 1.57606.
  I've tried it in a scientific calculator and x became 1.33005.
  What could be the problem in my code? Thank you!</p>
  
  <p><em>I'm sorry if there's anything wrong with my post structure because it's my first time to post here and English is not my native language</em></p>