Hi ,you guys:
look at the code below
////////////////////////////////////////////////////////////////////////////////////////////////
#include<iostream>
using namespace std;
int main()
{
double min,max,add;
while(1)
{
cout<<"Please Input The Range of C (min max): ";
cin>>min>>max;
cin.ignore(20,'\n');
cout<<"Please Input The Increment : ";
cin>>add;
for(double C=min;C <= max;C+=add)
cout<<C<<endl;
}
return 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
Compiler : Bloodshed Dev C++ 4.9.9.2
if I input 3.2 3.6 0.1 ,it will NOT output 3.6
but if 3.5 3.6 0.1 ,it will.
if 2.2 2.4 0.1, it will NOT output 2.4,
but if 0.2 0.4 0.1, it will output 0.4.
some other numbers would occurence like this ...
if I want to use FLOAT numbers as the condition statement, how can I
implemet it?
Thanx in advance !