Check whether the input number is arm-strong or not


Module Module1

Sub Main()
'Program to check whether the input number is armstrong or not

'decalring the variables
Dim entry, num, check, temp As Integer

Console.WriteLine("Enter the number to check whether the number is arm strong or not")
entry = Console.ReadLine()

num = entry
While num <> 0
temp = num Mod 10
check = check + temp ^ 3
num = num \ 10
End While

If entry = check Then
Console.WriteLine("The number is a armstrong number")
Else
Console.WriteLine("The number is not a palindrome number")
End If
Console.ReadKey()
End Sub

End Module

Comments

Popular posts from this blog

Program to extract vowel from the input string

Print the factorial value of an input number