How To Use * To Appear As Password In C++

Code:

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
char arr[20];
int j=0;
cout<<"Enter the Password "<<endl;
x:
arr[j]=getch();
cout<<"*";
j++;
if (j<5)
{
goto x;
}
if (arr[0]=='a' && arr[1]=='d' && arr[2]=='e' && arr[3]=='e' && arr[4]=='l' )
{
cout<<"\n\n\nyou are enter the program"<<endl;
}
else
cout<<"\n\n\nError"<<endl;

getch();
}

-----------------------------------------------------------------------------------------------------------------------
Share To:

Adeel Rasheed

Full Stack Website Developer

Post A Comment:

0 comments so far,add yours