Code:
if(i == (m*.2) || i == (m*.3) || i == (m*.4) || i == (m*.8))
You are comparing an integer type (i) with a float type (m * .2) for equality which is always a bad idea due to the imprecision of floating point numbers.
Your m-values are also constant so move them out of the loop.
stdout is usually buffered and only printed if the buffer is full or you print a newline. Use fflush(stdout) to force the output after every printf()-call without newlines.
All in all I suggest something like:
Code:
#include <stdio.h>
int main(void)
{
unsigned long i, m = 1000000000;
unsigned long m1 = m * .2, m2 = m * .3, m3 = m * .4, m4 = m * .8;
for(i = 0; i < m; i++)
if(i == m1 || i == m2 || i == m3 || i == m4)
{
printf(" * ");
fflush(stdout);
}
putchar('\n');
return 0;
}
Bye, Andreas