Check the implementation for yor problem. The length of the UserName and Password are restricted to 10, but you may change it as you wish.
#include <stdio.h>
#include <conio.h>
main()
{
char UserName[10], Password[10];
printf("\nEnter User Name :");
scanf("%s", UserName);
printf("\nEnter Password :");
char ch; int i=0;
while((ch=getch())!=13)
{
Password[i] = ch;
putch('*');
i++;
}
Password[i] = '\0';
printf("\nThanks\nYour Password is :%s\n", Password);
}
Venkat
|