i know this may seem odd but i want to read in an input starting with a 0
its a menu selection
the menu options need to be
100000
100010
000010
000011
it works for the numbers starting with a 1, but not the numbers starting with a 0.Code:void readnum(int a, int b) { unsigned int code = 0; printf(options); scanf("%u", &code); while (code != 100000 && code !=100010 && code !=000010 && code !=000011) { printf(options); scanf("%u", &code); } if (code == 100000) add(a, b); if (code == 100010) sub(a, b); if (code == 000010) mult(a, b); if (code == 000011) div(a, b); }
thanks!



LinkBack URL
About LinkBacks



but it did what i needed.