Showing posts with label Username and Password (login id and password) in C.. Show all posts
Showing posts with label Username and Password (login id and password) in C.. Show all posts

Friday, July 31, 2020

Write a Program to demonstrate use of Username and Password (login id and password) in C.

Username and Password (login id and  password) in C.


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

  printf("Enter your Username ::");
 gets(username);
 
 printf("Enter your Password ::");
 gets(password);
 
 if(strcmp(username,"student123")==0 && strcmp(password,"admin@123")==0)
  printf("\n Welcome....\n Login Successfully");
 else
  printf("Invalid Username/Password.");
 return 0;
}


OUTPUT

Enter your Username ::student123
Enter your Password ::admin@123

 Welcome....
 Login Successfully