adventuretimeh

Password text mask

Sep 28th, 2019
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void main()
  5. {
  6. char password[10],username[10], ch;
  7. int i;
  8.  
  9. printf("Enter User name: ");
  10. gets(username);
  11. printf("Enter the password : ");
  12. for(i=0;i < 8;i++)
  13. {
  14. ch = getch();
  15. password[i] = ch;
  16. ch = '*' ;
  17. printf("%c",ch);
  18. }
  19. password[i] = '\0';
  20.  
  21. /* If you want to know what is username & password, you can print it*/
  22. printf("\n\nYour username is : %s ",username);
  23. printf("\nYour password is : %s",password);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment