-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfor loop
More file actions
33 lines (29 loc) · 765 Bytes
/
for loop
File metadata and controls
33 lines (29 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
int a, b;
scanf("%d\n%d", &a, &b);
// Complete the code.
for(int i=a;i<=b;i++){
if(i<=9){
switch(i){
case(1):{printf("one");break;}
case(2):{printf("two");break;}
case(3):{printf("three");break;}
case(4):{printf("four");break;}
case(5):{printf("five");break;}
case(6):{printf("six");break;}
case(7):{printf("sever");break;}
case(8):{printf("eight");break;}
default:{printf("nine");break;}
}
}
else if(i%2==0){printf("even");}
else{printf("odd");}
printf("\n");
}
return 0;
}