challenge 1#

+1 choton rabbi · February 4, 2015
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#define SYMBL '$'
int main(void)
{
char passwd[17];
printf("Enter your user password : ");
scanf("%s", passwd);
int count, UpLetNo, LoLetNo, NumerNo, DolSymNo, SymblNo;
count = UpLetNo = LoLetNo = NumerNo = DolSymNo = SymblNo = 0;
while( count < strlen(passwd) )
{
if( isupper(passwd[count]) )
{UpLetNo++;}
else if( islower(passwd[count]) )
{LoLetNo++;}
else if( isdigit(passwd[count]) )
{NumerNo++;}
else if( passwd[count] == SYMBL )
{DolSymNo++;}
else
{SymblNo++;}
count++;
}
if( !((UpLetNo != 0) && (LoLetNo != 0) && (NumerNo != 0) && (DolSymNo != 0) && (passwd != "") && (passwd != NULL)) )
{printf("Hey, your password sucks!!!");}
else
{printf("Ok, your password is good to go....");}
return 0;

Post a Reply

Replies

Oldest  Newest  Rating
0 choton rabbi · February 5, 2015
Thanks for your suggestion.
0 choton rabbi · February 4, 2015
i didn't get any error without "}" in the end.
  • 1

C

107,156 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator