Sep 30, 2011

C Program to mask password text with *

C Program to mask password text with *. This program is to illustrate how user authentication is made before allowing the user to access the secured resources. It asks for the user name and then the password. The password that you enter will not be displayed, instead that character is replaced by '*'. Read more about C Programming Language .

* You can use all the programs on
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact
* To find more C programs, do visit
* and browse!
*                        Happy Coding

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

void main()
 char pasword[10],usrname[10], ch;
 int i;


 printf("Enter User name: ");
 printf("Enter the password <any 8 characters>: ");

  ch = getch();
  pasword[i] = ch;
  ch = '*' ;

 pasword[i] = '\0';

 /*If you want to know what you have entered as password, you can print it*/
 printf("\nYour password is :");

Read more Similar C Programs
Searching in C

C Strings

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!