Thursday, March 5, 2015

C Program on entering password


In this C language program, user will enter any word or sentence and the entered word or sentence will be treated as a password. Entered characters will be echoed as ‘*’ and finally the password will be displayed.



#include < stdio.h >
void main()
{
 char ch[100];
 int i=0;
 int x;
 clrscr();
      printf("\nEnter Password:");
 while(1)
 {
 x=getch();
 printf("*");
  if(x==13)
   break;
   ch[i]=(char)x;
   i++;
   }
   printf("\nEntered password is=%s",ch);
   getch();

   }

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner