Hi , I can do this, I can see some errors in ur code, but I need to know exactly what printFrac is supposed to do, print a given number character by character to the specified decimal place?
If you can reply back with a sample example of how o/p has been derived it will be easy.
x = 0.7712 and r=5,
int left =x*r; // left = 3
//getting the left side of the decimal
float org=x*r; // orig = 3.856
//getting the mult of radix and value
float right =org-left; // right = 0.856;
//getting the right side of the decimal
char ch ;
ch= int2char(r, left); // r= 5 and left = 3
putchar (ch); // output = 3 // which voids ur statement as, first two character needs to be ""0" & "."
Please getback, In the mean time , i will try to figure out what u r exactly trying to achieve.