Why the program not ends when i give "jk" as input?

#include
using namespace std;
int main()
{
char c[100];
for(int i=0;;++i)
{
cin.getline(c,100);
if(c==“jk”)
break;
cout<<c<<endl;
}
return 0;
}

Hello @prerak_semwal i have corrected your code and now it is passing eveyr test case:
https://ide.codingblocks.com/s/395269
i have commented the mistake.
if you have any doubt you can ask here:
Happy Learning!!

@tusharaggarwal272but i dont want to give the middle contraint of for loop…so as to make it an infinite loop without giving any middle contraint??

@tusharaggarwal272also your code’s also giving wrong output…???

@prerak_semwal i think that condition is necessary because there must be some condition to end.
if you want to do with the infinite loop then you can do it with while loopi.e
while(true){
//your code goes here.
}

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.

@tusharaggarwal272your code is also not giving “jk” as output…my doubt isnt cleared yet??