Divisible by 7
Submissions: 609   Accuracy:

38.58%

  Difficulty: Easy   Marks: 2

Given an n-digit large number in form of string, check whether it is divisible by 7 or not.

Input:
The first line consists of an integer T i.e number of test cases. The first and only line of each test case consists of string s.

Output:
If s is divisible by 7 then print "1" otherwise print "0".

Constraints: 
1<=T<=100
1<=|Length of string|<=104

Example:
Input:

2
100000000000
8955795758

Output:
0
1

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

Contributor: Saksham Ashtputre
Author: saksham0751


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.