Thread: building a password

  1. #1
    Registered User
    Join Date
    Apr 2017
    Posts
    12

    building a password

    Hi.

    Could someone please explain to me why this is wrong and how to fix it. thank you.

    Code:
    
    int main()
    {
       char password [20];
       int x=0;
       printf("please enter a password with one number and one uppercase letter: ");
       scanf("%c", &password);
        scanf("%d", &x);
        if (x<0)
        {
            printf("please enter at least one number \n");
    
    
    
    
        }
        if (isupper != (password))
        {
            printf("please enter at least one upper case");
        }
    
    
    }

  2. #2
    Registered User
    Join Date
    Feb 2012
    Posts
    347
    If i understand correctly. You can probably read the value entered by the user into string. Then you can start processing from the beginning of the string. You also need to tell the user correct format of password.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 06-29-2014, 02:08 AM
  2. Building a NFA help
    By crashband in forum C Programming
    Replies: 6
    Last Post: 10-25-2013, 03:14 PM
  3. help with building
    By Darkinyuasha1 in forum Windows Programming
    Replies: 1
    Last Post: 02-10-2013, 03:00 AM
  4. Replies: 2
    Last Post: 01-07-2009, 10:35 AM
  5. building/using dll's
    By bluehead in forum C++ Programming
    Replies: 1
    Last Post: 04-05-2005, 07:03 AM

Tags for this Thread