I made this code for Challenge#1 but for some reason it wont run, can someone help me out?

0 rasen itachi · June 1, 2015
char name[11];

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

scanf("%c",&name);

if(isupper(name[0||1||2||3||4||5||6||7||8||9]))

   {
       if(isdigit(name[0||1||2||3||4||5||6||7||8||9]))

        {printf("Nice Password");}

       else{printf("Try again")};

   }

   else{printf("Try again");}


    return 0;

Post a Reply

Replies

Oldest  Newest  Rating
0 Dol Lod · June 2, 2015
Yes, IDK what language you are doing but it is not C++, but  your first if condition with isUpper, you would need ot use && for each call to isUpper with isUpper taking in a character.

Additionally, you need to include <ccytype> and <cstdio>.

The scanf should also have %s as its first argument isntead of %n. 

This code should also be located within the main function.

That's all I can think of for right now.
0 rasen itachi · June 3, 2015
Oh thanks. Its working now :)
0 Suraj Gautam · June 4, 2015
rasen bro I already completed this challenge ;)
ask me hehe
  • 1

C

107,268 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator