switch not working.Code:#include <stdio.h> #include <string.h> int main() { char username[16]; char pass[16]; char conf_pass[16]; short int condition = 0; short int i = 0; short int j = 0; int opt_no = 0; printf("\n**************ADMISSION*PROGRAM*FOR****************"); printf("\n********************STUDENTS***********************"); printf("\n\n"); printf("\n1.LOG IN"); printf("\n2.CREATE ACCOUNT"); printf("\nEnter Option No.:\t"); scanf("%d", &opt_no); switch(opt_no) { case '1': break; case '2': printf("\nEnter Desired Adiminisrator User Name:\t"); scanf("%s", username); printf("(Enter Desired Password Not Less Than 8 Characters"); printf("\nAnd Not More Than 16 Characters.)"); while(condition == 0) { printf("\n\nPassword:\t\t"); scanf("%s", pass); j = strlen(pass); if(j < 8) { printf("\nError.Password is less than 8 characters."); } if(j > 16) { printf("\nError.Password is more than 16 characters."); } if(j >= 8 && j <= 16) { printf("Confirm Password:\t"); scanf("%s", conf_pass); i = strcmp(pass, conf_pass); if(i != 0) { printf("Error! Passwords do not match"); } if(i == 0) { condition = 1; } } } } return 0; }
PS: Code not finished, need a little help NOT HOMEWORK.
PPS: New to programming.