Divisibility rule by 7

This code helps us to verify whether a number is divisible by 7 using the divisibility rule
177.0 次下载
更新时间 2011/9/14

查看许可证

1 we express a number as a linear combination of powers of 10
2 for example
1980=1*10^3+9*10^2+8*10^1+0*10^0
we get [1 9 8 1]
apply divisibility rule by 7
remaining digits-2(last digit)
k=1
1 9 8 -2(1)=196
k=2
19 - 2(6)=7
k=3
0-2(7)=-14 which is divisible by 7
stop we get a negative number

引用格式

Diyashvir Kreetee Rajiv Babajee (2024). Divisibility rule by 7 (https://www.mathworks.com/matlabcentral/fileexchange/32877-divisibility-rule-by-7), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

rename title

1.0.0.0