Password
Posted by mark123
Last Updated: March 17, 2012
  1838

you must all a user to enter

A strong password that will include 2 or more of these characteristics

use of uppercase,

use of numbers

if the following criteria is not met users should be prompted of the error and allowed to re-enter password.

   
  
 
 
   

 
 
#include<stdio.h>
#include<ctype.h>
#include<string.h>
int main(void)
{
char pass[13];
int strleng,i;
puts("Enter a password:");
scanf("%s",pass);
strleng=strlen(pass);
for(i=0;I<strleng;i++)
{
if(isdigit(pass[i]))
{
}
else
if(isupper(pass[i])
{
}
}
getch();
}


I am not sure what to put in those statements can someone help me out?
 
#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main(void)
{
for(;;)
{
char pass[35];
int strleng;
int digit = 0;
int upper = 0;
puts("Enter a password:");
scanf("%s",pass);
strleng=strlen(pass);

for(int i=0;i<strleng;i++)
{
   if (isupper(pass[i]))
  {
     upper = 1;
  }
  
  if(isdigit(pass[i]))
  {
    digit = 1;
  }
}
   
   
   if(upper == 1 && digit == 1)
   {
    break;        
   }

}

printf("Successful");

getch();
return 0;
}
 
i think i can evaluate it from here. thanks