Password program.
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main ( )
{
char masterlist[6][10] = { "akshya", "dipankar", "sanjay", "nilanjan", "sankar", "gopal" };
char yourname[10];
int i, flag = 0;
clrscr ( );
printf("\n\n\n\t Enter your name....:"); gets(yourname);
for ( i = 0; i <= 5; i++)
{
if ( strcmp( yourname, masterlist[i] ) == 0 )
{
printf("\n\n\n\t\t WELCOME, YOU CAN ENTER THE PALACE!");
flag = 1;
break;
}
}
if ( flag == 0 )
{
printf("\n\n\n\t\t SORRY, YOU ARE A TRESPASSER!");
}
getch ( );
}
Click here to contact us
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main ( )
{
char masterlist[6][10] = { "akshya", "dipankar", "sanjay", "nilanjan", "sankar", "gopal" };
char yourname[10];
int i, flag = 0;
clrscr ( );
printf("\n\n\n\t Enter your name....:"); gets(yourname);
for ( i = 0; i <= 5; i++)
{
if ( strcmp( yourname, masterlist[i] ) == 0 )
{
printf("\n\n\n\t\t WELCOME, YOU CAN ENTER THE PALACE!");
flag = 1;
break;
}
}
if ( flag == 0 )
{
printf("\n\n\n\t\t SORRY, YOU ARE A TRESPASSER!");
}
getch ( );
}
Click here to contact us
No comments:
Post a Comment