Algorithm for program in C# to calculate the reverse of a number, to check the given number is palindrome or not, to check the given number is Armstrong or not, and to calculate the sum of all the digits of a number.
Step 1: Start
Step 2: Declare n, r, a=0, s =0, num, sum=0
Step 3: Read n
Step 4: Condition while(n>0)
Yes:
a) r
= n % 10
b) s
= (s * 10) + r
c) a
= a + (r * r * r)
d) n
= n / 10
e) sum = sum + r
No:
Jump to step 5
Step 5: Print s, sum
Step 6: Condition if (num == s)
Yes: Print “Given Number is Palindrome”
No:
Print “Given Number is NOT Palindrome “ and jump to step 7
Step 7: Condition if(num == a)
Yes: Print “Given Number is Armstrong”
No:
Print “Given Number is NOT Armstrong “ and jump to step 8
Step 8: