Today I am here with a new program that will input a number from the user and determine whether it's Armstrong number or not.
Armstrong number
- So, below is the source code of this program.
- Source code
Output
Explanation:
In this program,we will input a number from the user.
Line # 11:
At this line, there is a loop that explains that if the user enters "0", this loop would be terminated.
Line # 13:
It will take the modulus(remainder) of the number being entered by the user.
Line # 14:
Now it will divide the given number by 10.
Line # 18:
If the given result would be equal to check(or given number),then it will display that it is an Armstrong number other it will display that it is not an Armstrong number.
If you have still any ambiguity in understanding the logic of this program, then feel free to contact me at "G.A.Mujtaba11@gmail.com".
No comments:
Post a Comment