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;
}
Post A Comment:
0 comments: