I am getting problem with this code(compiled with dev c++)
When i enter the any value for i greater than 1 it is working fine.
using namespace std;
cout << "\n Enter the double value";
cout<<"\n Enter a positive integer ";
cerr<<"error i= "<<i<<endl;
cout<<"enter a positive integer: ";
But when i enter the floating point value less than 1 it goes into infinite loop.
i am experimented with other float values -4.56,-3.5 any float less than 1.
Example input which leads to infinite loop
enter a double value :46.7
Enter a positive integer: 0.56
my doubt is that, i is integer, so it should takes only value without fraction part. It is works fine for i=0 and why not for 0.67 or any floating less than 1.