5. Write a program in javascript to accept password from user and check whether it is of minimum 8 characters or not
Answers
Answered by
0
Answer:
class main
{
public static void password ( int x)
{
int b=x;int c=0;int a=0;
while(b!=0)
{
a=b%10;
c++;
b=b/10;
}
if(c>=8) // or if the password must be exactly 8 digits then, if(c==8)
System.out. println(" password is of 8 digits");
else
System.out.println(" password is not of 8 digits");
}
}
Explanation:
Similar questions