i wrote a C program that check if the passwords has an uppercase,a number, and an alphabet, what i want to know is a way of doing this more efficiently?, because on the code that i wrote in each if statement i have 5 if OR's
#include<stdio.h>
#include<ctype.h>
#include<string.h>
int main(void)
{
char password[7];
scanf("%s",password);
int len;
len=strlen(password);
int x=0;
if (len<6)
{
puts("password too short");
}
else if (len>6)
{
puts("password too long");
}
if (isalpha(password[0]) || isalpha(password[1]) || isalpha(password[2]) || isalpha(password[3])||isalpha(password[4]) || isalpha(password[5]));
else
{
printf("no alpha found\n");
}
if (isupper(password[0]) || isupper(password[1]) || isupper(password[2]) || isupper(password[3])||isupper(password[4]) || isupper(password[5]));
else
{
printf("no uppercase found\n");
}
if (isdigit(password[0]) || isdigit(password[1]) || isdigit(password[2]) || isdigit(password[3])||isdigit(password[4]) || isdigit(password[5]));
else
{
printf("no number found");
}
}