Tuesday 23 November 2010

C code for reading password of fixed length

void main()
{
char password[25];
int length,i;


//length specifies length of password
scanf("%d",&length);
for(i=0;i<length;i++) {
password[i]=getch();
printf("*");
}
// further you can use variable password anywhere


// check it out


}