Check if divisible by 10
Submissions: 1439   Accuracy:

23.04%

  Difficulty: Easy   Marks: 2

Given a binary number in the form of string. The task is to check whether the decimal representation of the given binary number is divisible by 10 or not. The number could be very large and may not fit even in long long int.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow.
Each test case contains a number N as input.

Output:
For each test case, print "1" if the decimal representation is divisible by 10 else print "0".

Constraints:
1<=T<=500
1<=|Number length|<=105

Example:
Input:
2

10
1010

Output:
0
1

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Arun Tyagi
Author: arun03


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.