Password program in c language.

                    Password program in c language

Password program can used for security purposes.We have seen it's application in many fields.For example during facebook login,gmail account login,for online transaction etc.
       

   We can hide our password by using this program with asterisk.
  We have seen that our password get mask with asterisk whenever      we login our facebook account,gmail account.





    






 Let discuss the program behind this why it gets   mask with asterisk.

                Mask password with asterisk 

        This program has successfully run in turbo compiler.I personally use this editor
                for writing my c program.


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
    clrscr();
    char password[30],char username[20],ch;
    int i;
    printf("Enter username\n");
    gets(username);
    printf("Enter 8 digit password\n");
   for(i=1;i<=8;i++)
   {
        ch=getch();
        password[i]=ch;
        ch='*';
        printf("%c",ch);
   }
        password[i]=' ';     
     
      /*  
           To show original password
                                                       */

  printf("Your password is\n");
  for(i=1;i<=8;i++)
  {
         printf("%c",password[i]);
  }   
     getch();
}
               






Password program in c language. Password program in c language. Reviewed by Deepak kumar soni on December 29, 2018 Rating: 5

No comments:

Powered by Blogger.