This program should work for both the condition , atleast i think, but for some values it's not working as supposed.
static void Main(string[] args)
{
    double num, temp = 0;
    double frac;
    int j = 1;
    num = 1034.264;            
    do
    {
        j = j * 10;
        Console.WriteLine(j);
        temp = num * j;
        Console.WriteLine(temp);
    }
    while ((temp % 10)!=0);
}
For value 1034.347 , its working fine --
but for value 1034.235 not working 1034.235 it is going to infinite
 
     
    