Pages

Friday, October 9, 2015

C program to demonstrate use of Username and Password (login id password) functionality.

Login ID Password Program


// Username and Password (LoginID Password) functionality using C.
// Username: student
// Password: guest

#include<stdio.h>
#include<string.h>
int main()
{
 int i;
 char ch1, username[10], password[10];

 printf("Enter your Username:");
 gets(username);
 
 printf("Enter your Password:");
 gets(password);
 
 if(strcmp(username,"student")==0 && strcmp(password,"guest")==0)
  printf("\n Welcome....\n MENU...Main Logic of Program..");
 else
  printf("Invalid Username/Password.");
 return 0;
}

Output of Program

Enter your Username:student
Enter your Password:guest

 Welcome....

 MENU...Main Logic of Program..

 



No comments:

Post a Comment