Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Armstrong
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) 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
0
Please
log in
to post a comment.
Left circular rotation of an array
Compare 2 int
Vídeo01 - Classes e Métodos
Array Comparison
Linq
Returning the number of 1s in the binary representation of an unsigned integer
Dungeon Game
actions and tasks
Linq join to tables
expresiones switch
Please log in to post a comment.