Here is source code of the C# Program to Print all the Armstrong Numbers from 1 to 1000. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
* C# Program to Print all the Armstrong Numbers from 1 to 1000
static void Main()
int a, b, c, d;
for (int i = 1; i <= 1000; i++)
a = i / 100;
b = (i - a * 100) / 10;
c = (i - a * 100 - b * 10);
d = a * a * a + b * b * b + c * c * c;
if (i == d)
Here is the output of the C# Program:
1 153 370 371 407 1000
Sanfoundry Global Education & Learning Series – 1000 C# Programs.