Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
amstrong number
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public 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"); } else Console.Write("Entered Number is not an Armstrong Number"); Console.ReadLine(); } } }
run
|
edit
|
history
|
help
1
rd
temp1
sxsadxasxd
DN2
Конструктор классов + static
asxsdxsd
Fórum ➡ GroupJoin'ing Books and Orders ( with Zip'ped output ) ♦
NeedFirst
Cotton Farm 0.0.2.02
Display the pattern like diamond by using c# for loop