WAP that take id password and check whether it is correct or not


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
 char id[5],pass[5];

 clrscr();

  printf("\n\n\n\n\n\t\t\t\t\t Enter ID:- ");
  gets(id);
  printf("\n\t\t\t\t\t Enter Password:- ");
  gets(pass);

 if(strcmp(id,"admin") == 0 && strcmp(pass,"12345")==0)
  {
  clrscr();
  printf("welcome");
  }
 else
  {
  clrscr();
  printf("sorry wrong password");
  }


 getch();

}

No comments:

Post a Comment