Professional Documents
Culture Documents
Print Century
Print Century
Print Century
xhtml
Print Century
The program must accept two integers X and Y as the input. The program must print the output based on the below conditions,
Example Input/Output 1:
Input:
120 50
Output:
YHALFCENTURY
Example Input/Output 2:
Input:
90 100
Output:
YCENTURY
https://www.skillrack.com/faces/candidate/codeprogram.xhtml 1/4
5/30/2021 https://www.skillrack.com/faces/candidate/codeprogram.xhtml
Ambiance
C ( gcc 8.x)
Reset
https://www.skillrack.com/faces/candidate/codeprogram.xhtml 2/4
5/30/2021 https://www.skillrack.com/faces/candidate/codeprogram.xhtml
1 #include<stdio.h>
2 #include<stdlib.h>
3
4 int main()
5 {
6 int x,y;
7 scanf("%d %d",&x,&y);
8 if (x>=100 && y>=100)
9 {
10 printf("XYCENTURY");
11 }
12 else if (x>=100 && y>50)
13 {
14 printf("XCENTURY");
15 }
16 else if (y>=100 && x>50)
17 {
18 printf("YCENTURY");
19 }
20 else if (x>=100 && y<50)
21 {
22 printf("XCENTURYSMALLY");
23 }
24 else if (y>=100 && x<50)
25 {
26 printf("YCENTURYSMALLX");
27 }
28 else if (x>=100 && y==50)
29 {
30 printf("YHALFCENTURY");
31 }
32 else
33 {
34 printf("XHALFCENTURY");
35 }
36 return 0;
37 }
https://www.skillrack.com/faces/candidate/codeprogram.xhtml 3/4
5/30/2021 https://www.skillrack.com/faces/candidate/codeprogram.xhtml
Save Run
https://www.skillrack.com/faces/candidate/codeprogram.xhtml 4/4