Challenge#1,Vid33 (I didnt get the $ part)

0 rasen itachi · June 2, 2015
So i got the code working for checking Capital letter and number but i didnt get how to check for $ sign..here's the code anyways:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>

int main()
{

char name[20];

printf("Enter the password here(20 digit or less):");

scanf(" %s",name);

if(isupper(name[0])||isupper(name[1])||isupper(name[2])||isupper(name[3])||isupper(name[4])||isupper(name[5])||isupper(name[6])||isupper(name[7])||isupper(name[8])||isupper(name[9])||isupper(name[10])||isupper(name[11])||isupper(name[12])||isupper(name[13])||isupper(name[14])||isupper(name[15])||isupper(name[16])||isupper(name[17])||isupper(name[18])
   ||isupper(name[19]))

   {
       if(isdigit(name[0])||isdigit(name[1])||isdigit(name[2])||isdigit(name[3])||isdigit(name[4])||isdigit(name[5])||isdigit(name[6])||isdigit(name[7])||isdigit(name[8])||isdigit(name[9])||isdigit(name[10])||isdigit(name[11])||isdigit(name[12])||isdigit(name[13])||isdigit(name[14])||isdigit(name[15])
          ||isdigit(name[16])||isdigit(name[17])||isdigit(name[18])||isdigit(name[19]))

        {printf("Nice Password");}

            else{printf("Try again");}



   }

   else{printf("Try again");}


    return 0;
}

Post a Reply

Replies

Oldest  Newest  Rating
0 Suraj Gautam · June 3, 2015
why you added the feature less than 20 in password. It is not asked?
  • 1

C

107,111 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator