Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Armstrong
//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 int Pow (int b , int p) { int e = 1; for (int i = 1 ;i <=p ;i++) { e = e*b; } return e; } public static bool IsArmstrong(int n) { int num = n; int res = 0; while (n>0) { res += Pow ((n % 10),3); n = n / 10; } if (res == num ) { return true; } return false; } public static void Main(string[] args) { int n = 153; Console.WriteLine(IsArmstrong(n)); } } }
run
|
edit
|
history
|
help
0
and
ref and out
MegaWays3
Math 10.8 added quad seq
Hello World
azs dasx
Everyone can sen ,only me can edi
Fortnite Generator
Irfan_Problem
3