Wednesday, August 24, 2011

C Program to accept a password

0 comments
This is a simple login C Program.While accepting password it makes each character using "*" symbol and display the password in the next line after the user hits the enter key.It also accept backspace and acts accordingly.

SOURCE CODE:

# 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=qetch(); 
if(ch==13
break; 
if(ch==8
{
 putch('b');
 putch(null); 
putch('b'); 
-i; 
continue

pw[i++]=ch; 
ch='*'
putch(ch); 
printf("nn%s",pw); 
getch(); 
}


Leave a Reply