print password in C
#include <stdio.h>int main()
{
char pwd[10],usr[10], ch;
int i;
printf("Enter User name: ");
gets(usr);
printf("Enter the password <any 8 characters>: ");
for(i=0;i<8;i++)
{
ch = getch();
pwd[i] = ch;
ch = '*' ;
printf("%c",ch);
}
printf("\nyour password is :");
for(i=0;i<8;i++)
{
printf("%c",pwd[i]);
}
}
output:
Enter User name: krishna
Enter the password <any 8 characters>:********
your password is :12345678
0 Comments