Password 3
Password 3
============================================
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
enum bool{false,true};
bool password()
{
int i=0;
char ch;
char p[30];
cout<<"\nEnter the Password: ";
cout.flush();
while((ch=getch())!='\r')
{
p[i]=ch;
cout<<"*";
cout.flush();
i++;
}
p[i]='\0';
if(strcmp(p,"farhan"))
{
cout<<"\nAccess is denied";
return false;
}
return true;
}
void main()
{
clrscr();
if(password())
cout<<"\nPassword Accepted";
else
cout<<"\nInvalid Password";
getch();
}
http://www.ravianeducation.blogspot.com
FARHAN: 03008855006