Divisible By 11
Computer Mathematics
Medium
2 views
Problem Description
Check divisibility by 11 using digit positions rule.
Input Format
One non-negative integer n.
Official Solution
Compute alternating sum of digits (odd positions minus even positions). If the difference is divisible by 11, print YES.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!