MOD 10 S = S + R N = N \ 10 ---Repeat above things until N reaches zero----- S is our Final Answer Question: Let N = 345, we want to find sum.. i.e. 5+4+3
MOD 10 S = S + 1 N = N \ 10 ---Repeat above things until N reaches zero----- S is our Final Answer Question: Let N = 245, we want to find no. of digits.. i.e. 3
S = S + R^3 N = N \ 10 ---Repeat above things until N reaches zero----- S is our Final Answer IF K=S THEN PRINT “ARMSTRONG” ELSE PRINT “NOT ARMSTRONG” Question: Let N = 345, we want to CHECK ITS ARMSTRONG property (Sum of cubed of digits is equal to original Number)
R = N MOD 10 S = S * R N = N \ 10 ---Repeat above things until N reaches zero----- S is our Final Answer Question: Let N = 345, we want to find product.. i.e. 5*4*3
MOD 10 S = S * 10 + R N = N \ 10 ---Repeat above things until N reaches zero----- S is our Final Answer Question: Let N = 345, we want to reverse it.. i.e. 543
10 S = S * 10 + R N = N \ 10 ---Repeat above things until N reaches zero----- S is our Final Answer IF K=S THEN PRINT “Palindrome” ELSE PRINT “NOT Palindrome” Question: Let N = 345, we want to test if it is palindrome. (A palindrome is a number, whose reverse is equal with the original number)