Convert a fraction to a repeated decimal
C, 108 79
Edit Modified to work with negative numbers.
Input from stdin. Old K&amp;R style.
main(a,b){char*s=&quot;-%d.&quot;;scanf(&quot;%d/%d&quot;,&amp;a,&amp;b);for(a*b&lt;0?(a&lt;0?a=-a:(b=-b)):++s;printf(s,a/b);s=&quot;%d&quot;)a=a%b*10;}