This program works okay except it prints the same messages more than once for unmatched letter. Can anyone give a solution to this?The programs very easy....
Code:#include<stdio.h> int main(void) { int tries = 0; char pass; for(tries = 0;tries<=5;tries++) { printf("Enter a letter to pass"); pass = getchar(); if(pass == 'b') {printf("welcome aboard"); break;} else {printf("try again \n");} } return 0; }