C Program To Accept Password
Submitted by Srikanth on Tuesday, 11 December 20076 Comments

This is a simple login program in C.While accepting password it masks each character using ‘*’ symbaol and display the password in the next line after the user hits Enter key.It also accepts backspaces and acts accordingly.
#include<stdio.h>
#include<conio.h>
char pw[25],ch;
int i;
void main()
{
clrscr();
puts(“Enter password”);
while(1)
{
if(i<0)
i=0;
ch=getch();
if(ch==13)
break; /*13 is ASCII value of ENTER*/
if(ch==8) /*ASCII value of BACKSPACE*/
{
putch(‘\b’);
putch(NULL);
putch(‘\b’);
–i;
continue;
}
pw[i++]=ch;
ch=’*';
putch(ch);
}
pw[i]=’\0′;
printf(“\n\n%s”,pw);
getch();
}
Popularity: 2% [?]
By using/following this site you agree to our Legal Disclaimer


Go home.
Wats great in this?
Good
hi Shrikant,
can you please tell me from where can i get c compiler
@ Virendra
Goto Borland site. Or search on google for Turbo C/C++ compiler
I was wondering if dev-c++ is a good compiler? and if it compiles in c also? Thanks
Leave your response!
EMAIL SECURITY »
How to Block Unwanted Emails
Do you want to block emails from your ex wife/husband? Do you want to block those annoying offers and newsletters that reach your inbox? Well here is a way to block all those unwanted and …
NETWORK HACKS »
How to Find the IP Address of a Remote Computer
Most of you may be curious to know how to find the IP address of your friend’s computer or to find the IP address of the person with whom you are chatting in Yahoo messenger or Gtalk. …
PC SECURITY »
10 Tips for a Total Online Security
With the sudden rise in the Internet usage across the globe over the past few years, there has also been a rise in the amount of online scams and frauds. Today most of the Internet users are unaware …
VIRUS CREATION »
A Virus Program to Disable USB Ports
In this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC). As usual I use my favorite C programming language to create this virus. Anyone with …
XP HACKS »
How to Hack Windows Administrator Password
This hack will show you how to reset Windows administrator password (for Win 2000, XP, Vista and Win 7) at times when you forget it or when you want to gain access to a computer …
Categories
Blogroll
Recent Comments
Most Commented
Most Popular
Log In | Entries (RSS) | Comments (RSS) | Sitemap | Arthemia Premium theme by Michael Jubel