i am not asking for you to do my homework, i am just asking for some pointers. i would ask my professor but i am taking the intro class online and he hasnt responded to my email yet and i want to figure this out. i am trying to write a code for a password 'cs' using a while loop. any advice would be great. thanks.
Code:#include <stdio.h> main () { char ch1; char ch2; int pass; printf("Please Enter Your Password>\n"); pass = 0; scanf("%c %c", &ch1, &ch2); while(!pass); { if (ch1 == 'c' && ch2 == 's'); else printf("Access Denied.\n"); scanf("%c %c", &ch1, &ch2); } printf("The door opens. Congratulations!\n"); }



LinkBack URL
About LinkBacks



