// Online C compiler to run C program online
#include <stdio.h>
#include <string.h>
int password_check(char *str){
int len = strlen(str);
int res =0;
int i,flag1,flag2,flag3,flag4;
if(len<7)
{
printf("Password lenghth should be grater than 7");
return res;
}
else
{
for(i=0;i<len;i++)
{
if(str[i]>='A' && str[i]<='Z'){
flag1=1;
}
else if(str[i]>='a' && str[i]<='z'){
flag2=1;
}
else if(str[i]>='0' && str[i]<='9'){
flag3=1;
}
else if(str[i]=='&' || str[i]=='#' || str[i]=='%' ||str[i]=='*' ||
str[i]=='$'){
flag4=1;
}
}
if(flag1==1 && flag2==1 && flag3==1 && flag4==1)
{
res=1;
}
}
return res;
}
int main() {
// Write C code here
printf("Try programiz.pro\n");
char *pass ="a1fghjkl";
int res=password_check(pass);
if (res == 0)
{
printf("INVALID PASSWORD\n");
}
else
{
printf("VALID PASSWORD\n");
}
return 0;
}