You are viewing a single comment's thread. Return to all comments →
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { int a, b; scanf("%d\n%d", &a, &b); char labels[11][6] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "even", "odd"}; int labels_index; for (int i=a; i<=b; i++) { labels_index = i <= 9 ? i - 1 : 9 + i % 2; printf("%s\n", labels[labels_index]); } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
For Loop in C
You are viewing a single comment's thread. Return to all comments →