float x; float sum = 0.0; for (x = 1.00; x < 2.00; x += 0.01) sum += x; printf ("%.2f\n", sum); // this rounds the result