#include <stdio.h> #include <stdlib.h> int main() { int no=0; int blueteam=0; int redteam=0; char name[15]; char END; printf("Type END to exit\n"); printf("Note:Make sure the first alphabet is in Uppercase.\n"); do { printf("\nStudent Number:%d\t Redteam:%d\t Blueteam:%d",no,redteam,blueteam); printf("\nEnter the First name:"); scanf(" %s", name); if(name[0] > 'M') { printf("Selected for Blueteam\n"); blueteam++; } else { // So if name[0] is 'E' for END, you will come here printf("Selected for Redteam\n"); redteam++; } no++; } while(name[2]=="END"); // this won't work return 0; }
}while(name[2]=="END");
}name[2]);
"END"
}while(name[2]==END);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)