Whats wrong in my code html lunchtime problem

#include
using namespace std;

int main()
{
int t;
cin>>t;
string s;
int flag=1;
while(t–)
{
cin>>s;

if(s.size()<=3)
{
//cout<<“error”<<endl;
flag=0;
}
if(s[0]!=’<’&&s[1]!=’/’&&s[s.size()-1]!=’>’&&flag!=0)
{
// cout<<“error”<<endl;
flag=0;

}

if(flag!=0)
for(int i=2;i<s.length()-1;i++)
{
if(!(islower(s[i])||isdigit(s[i])))
{

                              flag=0;
               }

}

if(flag==1)
cout<<“success”<<endl;
else
cout<<“error”<<endl;

flag=1;

}

// your code goes here
return 0;

}

Why have you mentioned && while checking for the HTML tags, they will give error incase anyone of them is missing
Correct Code :

int t;
cin >> t;
string s;
int flag = 1;
while (t--)
{
	cin >> s;

	if (s.size() <= 3)
	{
		flag = 0;
	}

	if (s[0] != '<' || s[1] != '/' || s[s.size() - 1] != '>')
	{
		flag = 0;

	}


	for (int i = 2; i < s.length() - 1; i++)
	{
		if (!(islower(s[i]) || isdigit(s[i])))
		{

			flag = 0;
		}
	}

	if (flag == 1)
		cout << "success" << endl;
	else
		cout << "error" << endl;

	flag = 1;

}

But bhai galat kya hai && use karne me agar koi bhi statement teeno me se false hoti hai toh error answer show karenge na??? Test case se samjhado

Your if condition will only executive if all of them are not present in Input example that if will only execute for test case hello & not for test case < hello>