We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
if (n >= 0 && n <= 9)
{
printf("%s\n", digitNames[n]);
}
if (n>=10){
printf("nine\n");
}
}
void oddeven(int m){
int odd,even;
if(m%2==0){
printf("even\n");
}else{printf("odd\n");}
}
int main() {
int digitstore[2];
for (int i = 0; i < 2; i++) {
scanf("%d", &digitstore[i]);
}
for (int i = 0; i < 2; i++) {
digitnames(digitstore[i]);
}
for (int i = 0; i < 2; i++) {
* oddeven(digitstore[i]);
}
return 0;
}
Cookie support is required to access HackerRank
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 →
include
void digitnames(int n){ char *digitNames[] = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
} void oddeven(int m){ int odd,even; if(m%2==0){ printf("even\n"); }else{printf("odd\n");} } int main() { int digitstore[2]; for (int i = 0; i < 2; i++) { scanf("%d", &digitstore[i]); }
* oddeven(digitstore[i]); }
}