CPP Webinar : 2-D arrays,string

what is the difference between while(i!=0) and while(i>=0)?
i used while(i!=0) and by inputing coding blocks i got answer cksioding blo. but when i used while(i>=0) i got correct anwer as cksCoding blo

Hello @itsexp_2302,

  1. while(i!=0){}
    This will terminate only if i is/becomes 0
    i.e. it will execute for negative values of i also.

  2. while(i>=0)
    This will terminate for any negative value of i.
    i.e it will execute only for i=0 and positive values.

But, it is difficult to point the error that you are taking about.
It would be helpful if you would share your code.

Hope, this would help.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.