You are on page 1of 1

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

You might also like