Stephanie News, Dell USB Drivers, Android Devices, Charging, Apple, Nokia Flash File, Samsung Galaxy

Jumat, 27 Desember 2013

Program to Print Armstrong numbers in C#

Program to Print Armstrong numbers in C# - with the rapid development of today's technology we must enrich our knowledge of gadgets, because every day there are many new gadgets that are made with advantages, in blogs Stephanie News we will meriview many gadgets from various brands ranging from the specification and its price .. Now we will discuss first about Program to Print Armstrong numbers in C# please see our explanation to finish:

Articles : Program to Print Armstrong numbers in C#
full Link : Program to Print Armstrong numbers in C#
Article Csharp, Article programs,

You can also see our article on:


Program to Print Armstrong numbers in C#

C# Program to Print out all Armstrong numbers between 1 and 500

Program Statement:
Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number. For example, 153 = (1 * 1 * 1) + (5 * 5 * 5) + (3 * 3 * 3)

Solution:
 public class armstrong
{
int x, a, res, sum = 0;
public void find()
{
Console.WriteLine("\nAll Armstrong Numbers between 1 and 500 \n");
for (x = 1; x <= 500; x++)
{
a = x;
while (a != 0)
{
res = a % 10;
a = a / 10;
sum = sum + (res * res * res);
}
if (x == sum)
Console.Write(" {0} ", x);
sum = 0;
}
Console.WriteLine("\n");
}
}




we feel the information Program to Print Armstrong numbers in C# that's all.

hopefully the information Program to Print Armstrong numbers in C# that we have conveyed can provide benefits for you and all visitors of this blog, if any criticism and suggestions please comment.

you just read Program to Print Armstrong numbers in C# if this article is considered useful and you want to bookmark and share it please use the link https://stephaniefulke.blogspot.com/2013/12/program-to-print-armstrong-numbers-in-c.html and what if you want other information look for another page in this blog.

Tag : , ,
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : Program to Print Armstrong numbers in C#

1 komentar:


  1. pug puppies for sale,pug puppies for sale near me
    teacup pugs for sale,teacup pugs,teacup pug puppies for sale,teacup pug for sale near me,pug for sale near me,pug puppies for sale under,teacup pugs,pug puppies near me,teacup pugs,teacup pug puppies for sale,pug puppy for sale,mini pug,baby pugs for sale,pug breeders near me,pugs puppies for sale,black pug puppies for sale,miniature pug,pug puppies,pugs for sale near me,pugs for sale near me,pugs puppies,teacup pug puppies for sale,pugs for sale,baby pugs for sale
    Pug pupies for sale
    pug puppies for sale near me
    pug puppy for sale near me
    teacup puppies for sale near me
    Pug puppies for sale
    pugs for sale
    french bulldog puppies for sale
    French Bulldog Puppy for sale near me

    BalasHapus