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

No comments:

Post a Comment

Please do not any spam link in Comment Box