#include <iostream>
int main() {
long long n;
int password = 0;
printf("Enter your password: ");
scanf("%lld", &n);
while (n != 0) {
n /= 10; // n = n/10
++password;
}
if(password>8)
{printf("Correct password");
}
else if(password<=8)
{printf("In correct !!!");
}
}
with this code when a user enters his/her password it will count the number of integers in the password internally and if the number is greater than 8 characters it outputs correct and if below or equal to 8 output incorrect.
With this I hope it worked