Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h> // inkludiert eine C Library
- #include <conio.h> // eine weitere
- int main(void)
- {
- int eingabe1;
- int eingabe2;
- int username;
- int password;
- username = 742183; // dem int "username" wird eine Zahl zugewiesen
- password = 821590; // dem int "password" wird eine Zahl zugewiesen
- printf("Username:\n"); //Username wird abgefragt
- scanf("%d", &eingabe1); // Eingabe des Users wird zu "eingabe1" zugewiesen
- printf("Password:\n"); // Passwort wird abgefragt
- scanf("%d", &eingabe2); // Eingabe des Users wird zu "eingabe2" zugwiesen
- if(eingabe1==username) // wenn "eingabe1" 12 ist dann.....
- {
- printf("Username is correct!\n"); // wird auf dem Bildschirm "Username is correct" ausgegeben
- }
- else if(eingabe1!=username) // wenn sie jedoch nicht 12 ist
- {
- printf("Error: The Username you entered is incorrect\n"); // dann wird "The username you entered is incorrect" auf dem Bildschirm ausgegeben
- }
- while(eingabe1!=username) // wenn die eingabe nicht 12 ist dann
- {
- printf("Username:\n"); // aktiviert sich der while loop und der Username wird erneut abgefragt
- scanf("%d", eingabe1); // die eingabe des users wird "eingabe1" zugewiesen
- }
- if(eingabe2==password) // wenn "eingabe2" 11 ist dann...
- {
- printf("Password is correct,succesfully logged in!\n"); // wird "password is correct,succesfully logged in!" ausgegeben
- }
- else if(eingabe2!=password) // wenn sie jedoch nicht 11 ist dann
- {
- printf("Error: The Password you entered is incorrect!\n"); // wird "The Password you entered is incorrect!" ausgegeben
- }
- while(eingabe1 || eingabe2 != username || password)
- {
- printf("\n\n\n You entered invalid Information, the Application will terminate itself");
- }
- getch(); // wartet auf einen tastendruck um das programm zu beenden
- return 0; // das programm wird jetzt beendet/ ist beendet wordern
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement