Computer Science, asked by shashwat7378, 8 days ago

Write a program to read two integer values and print true if both the numbers end with the same digit, otherwise print false.

Example: If 698 and 768 are given, program should print true as they both end with 8.

For example, if the user gives the input as 25 53:

Enter two integer values : 25 53

then the program should print the result as:

false

Answers

Answered by BrainlyProgrammer
6

Answer:

The following códe is written in python

___

a,b=(int)(input("Enter a number:")),(int)(input("Enter a number:"))

isSame= "true" if a%10==b%10 else "false"

print("No. ends with same digit?",isSame)

Note:-

a,b=(int)(input("Enter a number:")),(int)(input("Enter a number:"))

  • You can also ask input in separate lines. The above is combination of two lines in order to shorten the códe

isSame= "true" if a%10==b%10 else "false"

  • you can also write this as...

if(a%10==b%10):

isSame="true"

else:

isSame="false"

Required Output Attached.

Attachments:
Answered by BrainlyPARCHO
0

\large { \fcolorbox{gray}{black}{ ✔\: \textbf{Verified \: answer}}}

Attachments:
Similar questions