title: fraction shortening C++
body: <p>I need to short fraction :
  4/5 * 3/4 = 12/20 , but i need to short it so answer must be: 3/5.
  I know that I must to use this function:</p>
  
  <pre><code>int NWD(int m1,int m2){
     int d;
     while((m1!=0)&amp;&amp;(m2!=0)){
      if(m1&gt;=m2) m1=m1%m2;
      else m2=m2%m1;
      return d=m1+m2;}
      }
  </code></pre>
  
  <p>So can you help me?</p>