Friday, December 26, 2014

Write a Program in C that Accept a Password



Write a Program in C that Accept a Password


#include<stdio.h>
#include<conio.h>

char pw[25],ch;
int i;
void main()
{
clrscr();
puts("Enter your Password");
while(1)
{
if(i<0)
i=0;
ch=getch();
if(ch==13)
break;
if(ch==8)
{
 putch('b');
 putch(NULL);
putch('b');
-i;
continue;
}
pw[i++]=ch;
ch='*';
putch(ch);
}
printf("your passward is\n %s",pw);
getch();
}

No comments:

Post a Comment