From b5c96080a3d5248efdbb115ae0f392dcbfadbad0 Mon Sep 17 00:00:00 2001 From: Kevin Ludwig Date: Thu, 8 Feb 2024 18:53:00 +0100 Subject: [PATCH] Passwortgenerator klein und grossbuchstaben --- src/passwortgenerator.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/passwortgenerator.c b/src/passwortgenerator.c index 1a19863..fe3f685 100644 --- a/src/passwortgenerator.c +++ b/src/passwortgenerator.c @@ -1,17 +1,20 @@ #include #include #include +#include int run_passwortGenerator(){ printf("\nPasswort Generator\n\n"); char zeichen[] = "abcdefghijklmnopqrstuvwxyz"; int tmp = 0; + int GroSSklein = 0; printf("\nIhr Passwort: "); srand(time(0)); for(int i = 0; i < 10; i++) { - tmp = rand() % 26; - printf("%c", zeichen[tmp]); + tmp = rand()%26; + GroSSklein = rand()%2; + printf("%c", (GroSSklein==0?toupper(zeichen[tmp]):zeichen[tmp])); } printf("\n"); return 0;