Description

In this program, we create a login system program which takes username and password from the user.

#include<stdio.h>
#include<conio.h>
#include<string.h>

int main(){
	char username[20];
	char userpassword[20];
	int i;
	
	printf("Enter the User Name : ");
	gets(username);
	
	printf("Enter the Password : ");
	gets(userpassword);
	
	printf("\n\n****\tEnter Any Key to Continue\t****");
	getch();
	
	if(!strcmp(username, "exampleuser") && !strcmp(userpassword, "example123")){
		printf("\n\n****\tLogin Successful\t****");
	}else{
		printf("\n\n****\tProvided Information Incorrect. Please Provide Right Information!!\t****");
	}
	return 0;
}
  • take username and password from the user
  • after taking the value from the user then compare the value is correct or not
  • if value is correct then "Login Successful" otherwise
  • "Invalid Credientials"

Comments

Login is mandatory to comment Please login

Recommended Posts

Program to print a message without using semicolon in c programming

How to write a c program to print a message without using semicolon in c programming language.

Function call by value in c programming language

The call by value technique of passing arguments to a function copies the particular value of an argument into the formal parameter of the function.

Call by Reference in C programming language

When we call a function and pass the variable / parameter in the function, when passing the address of the actual arguments from the calling function, that's why it is called call by reference.

C program to replace vowels with special characters

Write a c program to replace vowels with special characters.

File Read in C | File Handling | How to Read File

Write a program to read the file in c File Handling. How to read file is the main topic of file handling.

Insertion and deletion in doubly linked list in C program

Insertion and Deletion in Doubly linked list in C programming langauge Data Structure. How to Implement insertion and deletion all operation.