Here is source code of the C# Program to Check Whether the Entered Number is an Armstrong Number or Not. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
* C# Program to Check Whether the Entered Number is an Armstrong Number or Not
static void Main(string args)
int number, remainder, sum = 0;
Console.Write("enter the Number");
number = int.Parse(Console.ReadLine());
for (int i = number; i > 0; i = i / 10)
remainder = i % 10;
sum = sum + remainder*remainder*remainder;
if (sum == number)
Console.Write("Entered Number is an Armstrong Number");
Console.Write("Entered Number is not an Armstrong Number");
Here is the output of the C# Program:
Enter the Number : 371 Entered Number is an Armstrong Number
Sanfoundry Global Education & Learning Series – 1000 C# Programs.
If you liked this C# Program, kindly share, recommend or like below!