Many customers liked the gift articles with digits inscribed on them and they started buying them for gifting to Birthdays and anniversaries.
One customer came to purchase a gift for his mom's 25th wedding anniversary and another customer came to purchase a gift for his son's 18th Birthday. They were disappointed to see only single digits inscribed on the gift items.
Seeing the craze for this kind of gift items, Gita gave a bulk order for gift items with 2 digit numbers inscribed on them. The parcel arrived when she was busy and her 4-year-old son started arranging the newly arrived items in the rack for display. But he has placed all items upside down.
She needs to change the orientation of the items.
But to her surprise, she found that some 2-digit numbers were valid when read both ways. [Eg. 68 read upside down would be 89 which is also a valid number]
Help Gita in identifying all such 2 digit numbers.

Input Format:
Input consists of a 2-digit number.

Output Format:

The output consists of the string which is either 'yes' or 'no'. Print yes if the 2-digit number is valid even when it is read upside down. Otherwise, print no.

Sample Input 1:
18
Sample Output 1:
yes

Sample Input 2:
46
Sample Output 2:
no


Program Code:
#include<stdio.h>
int main()
{
    int a,b,c;
    scanf("%d",&a);
    b=a%10;
    c=a/10;
   if(((b==0)||(b==1)||(b==6)||(b==8)||(b==9))&&(( c==0)||(c==1)||(c==6)||(c==8)||(c==9)))
    printf("yes");
    else 
    printf("no");
    return 0;
}
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: