-1

This loop is not running for i = 1
It should run 100 times but it's only running 99 times

#include<iostream>
using namespace std;
int main() { 
   double i = 0.01, j = 0.01;
   while(i<=1){
       cout<<i<<' ';
       i = i+j;
   } 
return 0; 
}

1 Answers1

-2

Why don't start with i= 0.00, because 0.01 is already consuming first number. So 99 left.

faheem999
  • 52
  • 3