This seems like a very normal piece of code ...but I don't know why its showing abnormal behaviour .
#include <bits/stdc++.h>
using namespace std ;
int main()
{
string s ;
cin>>s;
for(int i =2 ; i < s.length()-2 ; i++)
{
cout<<"AAAA"<<endl;
}
}
For an input of a string of lenght 1 like 'B' ....The expected output should be nothing ..but instead the output is 'AAAA' infinite times ..can't figure out why the loop runs infiniye times