Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- char Username[30];
- char Password[30];
- void Login()
- {
- printf("Username: ");
- scanf("%s", &Username);
- printf("Password: ");
- scanf("%s", &Password);
- }
- void checkLogin()
- {
- if(strcmp(Username,"admin") == 0 || strcmp(Username,"user") == 0){
- if(strcmp(Password,"pws") == 0){
- printf("You have logged in successfully.\n");
- }else{
- printf("Wrong username or password.");
- exit(1);
- }
- }else{
- printf("Wrong username or password.");
- exit(1);
- }
- }
- int main()
- {
- Login();
- checkLogin();
- /*Start coding bawah ni*/
- printf("Test\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement