Beispiel #1
0
        static void ArmstrongLoop(int loopSize)
        {
            MathStuff ms = new MathStuff();

            for (int n = 0; n <= loopSize; n++)
            {
                if (ms.ArmstrongNumberCheck(n))
                {
                    Console.WriteLine("{0} is an Armstrong Number!", n.ToString());
                }
            }
        }
Beispiel #2
0
        static void Armstrong()
        {
            Console.Write("Enter number: ");
            int n = int.Parse(Console.ReadLine());

            MathStuff ms = new MathStuff();


            if (ms.ArmstrongNumberCheck(n))
            {
                Console.WriteLine("Armstrong Number!");
            }
            else
            {
                Console.WriteLine("Not Armstrong Number!");
            }
        }