This is pretty easy once you know how to distinguish it and analyze the problem. I'll even have it show some text like "ODD" and "EVEN" for you...
Code:#include <stdio.h> int main(void) { int input; char strings[1][5]; strcpy(strings[0], "ODD\0"); strcpy(strings[1], "EVEN\0"); printf("Give me a number: "); scanf("%i", &input); printf("This is a(n) %s number!", &strings[(input+1)%2]); getch(); return 0; }





Reply With Quote