A customer in the Personalised Gift Store is awarded a prize when their bill number is a 3-digit palindrome.
Help Gita in identifying the prize winners.

Input Format:
Input consists of a number which corresponds to the bill number.

Output Format:

The output consists of a string that is either 'yes' or 'no'. The output is yes when the customer receives the prize and is no otherwise.

Sample Input 1:
565
Sample Output 1:
yes

Sample Input 2:
568
Sample Output 2:
no

Sample Input 3:
66
Sample Output 3:
no


Program Code:
#include<stdio.h>
#include<math.h>
int main()
{
    int num,units,hundreds;
    scanf("%d",&num);
   
    if(num>99 && num<1000)
    {
        units=num%10;
        hundreds=(num/100);
     if(units==hundreds)
     {
         printf("yes");
     }
     else
     {
         printf("no");
     }
    }
    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: