int main()
{
    
    char username[9],username1[9];   
    char password [5],pass[5];
    int y=1,i=0;
    
    strcpy(username1,"udental");
    strcpy(password,"1987");
    
    display();
    
    
    do
    {
                 
                  
                  printf("\n\n\n\n\n\n\t\t\tPlease enter your username:");
                  scanf("%s",username);
                  
                  printf("\n\n\n\n\n\t\t\tPlease enter your password:");
                  
                  //problem/probelm
                            while((pass[i]=getch())!='\r')

                               {
                                       printf("*");

                                       i++;

                                }
                                                              
                           if (strcmp(username,username1)==0 &&  strcmp(password,pass) == 0)
                           
                            {
                                Sleep(1000);  
                                system("cls");
                                break;                                                                                                                 
                               
                             } 
                               
                           else 
                           
                            {
                                printf("\n\n\t\t\t YOU HAVE MADE AN INVALID INPUT");
                                printf("\n\n\t\t\t      PLEASE TRY AGAIN\n\n"); 
                                Sleep (1000);
                                system("cls");
                            }                             
                  
                  
                  y++;
                  
     }while(y<4);             
    
     menu(); 
    
    
    
    getch();
    return 0;
}

Edited 6 Years Ago by Nick Evan: Added code-tags

Certainly...What's the problem?

at the line marked problem, in the code ,i want to hide the password entered but i don't know if my coding is correct

This article has been dead for over six months. Start a new discussion instead.