C++ examples for Statement:for
Use float number to control for loop
#include <iostream> using namespace std; int main()//from w w w .j a va 2 s . c o m { double x = 0.0; double i; for (i = 0.0; i <= 100; i+=0.1) { x += i; } cout << x << endl; return 0; }