Every day few of the customers are given a lucky gift. The lucky gift is given to a customer when his / her bill number ends with the last digit of that day number or when the bill number is a multiple of the day number.
Can you help Gita in deciding whether a customer gets the lucky gift or not?

Input Format:
Input consists of 2 integers that correspond to the day number in today's date and the bill number.

Output Format:

The output is either 'yes' or 'no'. The output is yes when the customer gets the lucky gift and is no otherwise.

Sample Input 1:
5
45
Sample Output 1:
yes

Sample Input 2:
14
34
Sample Output 2:
yes

Sample Input 3:
5
44
Sample Output 3:
no


Program Code:
#include<stdio.h>
int main()
{
int day_no,bill_no;
scanf("%d%d",&day_no,&bill_no);
// printf("%d",bill_no/10);
if(((bill_no%10)==(day_no%10)) ||((bill_no%day_no==0)))
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:

1 comments: