As Sita orders for 300 adjacent alphabet puzzles, Gita decides to give 100 packs of Case letters free. In this pack, there will be multiple pieces and each piece will have 2 letters --- an uppercase letter and its corresponding lower case letter.
She wants to make sure that all the pieces in each puzzle pack are valid.
Gita says that the high tech scanner device can do this job also.
Can you guess what would be the program that is embedded in this device?
Input Format:
Input consists of a string containing 2 letters.
Output Format:
The output is either 'yes' or 'no'. The output is yes if the puzzle piece is valid and is no otherwise.
Sample Input 1:
Aa
Sample Output 1:
yes
Sample Input 2:
bB
Sample Output 2:
yes
Sample Input 3:
Qw
Sample Output 3:
no
Program Code:
#include<stdio.h>
#include<stdlib.h>
int main()
{
char s[100];
int q;
scanf("%s",s);
q=abs(s[0]-s[1]);
if(q==32)
printf("yes");
else
printf("no");
return 0;
}
Post A Comment:
0 comments: