Jose Velasquez

Generation

generate functionSat, 17 Jun 2023

un comando y su contraseña

void wrong() { printf ("you entered the wrong password"); } void right() { printf ("you entered the right password"); } int main () { int input = 0; char password [] = "password"; int counter = 0; char input1[10]; printf ("Enter password\n"); scanf ("%s", input1); while (input < 5) { if (strcmp (input1, password) != 0) { counter++; wrong (); } else { right (); break; } printf ("\nEnter password\n"); scanf ("%s", input1); } printf ("\nThe number of wrong times is %d", counter); return 0; }

Questions about programming?Chat with your personal AI assistant