Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h> //para sa printf
- #include <conio.h> //para sa getch
- #include <string.h> //Eto yung para sa strcmpna function di gagana yun kung wala to
- void main()
- {
- char pw[]="Hello"; //Eto yung password na iinitialize
- char temp[20]; //temporary character array (or string )
- printf("Input Password:"); //prompt for password
- scanf("%s",&temp); // %s= string input tapos ilalagay yung value na yun sa temp
- if(strcmp(temp,pw)==0) //yung ginagawa ng strcmp magrereturn ng 0 kung yung 2 string magkapareho
- {
- printf("Login Successful!"); //kung magkapareho yung tinype mo (temp) dun sa password (pw) magpapakita to
- getch(); //para di magclose yung program agad
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement