TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sandeep Banerjee
NA
249
264.9k
program to find armstrong number between 1 to 1000
Mar 14 2015 11:27 PM
sir,
why this code is not work i is run only for 1
using System;
public class Arm2
{
public static void Main()
{
int reminder, i, num;
for(i=1; i<1000; i++)
{
int sum = 0;
num = i;
while(num>0)
{
reminder = num % 10;
sum = reminder*reminder*reminder;
num = num/10;
}
if(sum == i)
{
Console.WriteLine("{0} is armstrong number.", i);
}
}
Console.ReadLine();
}
}
Reply
Answers (
2
)
ZIp file is empty ?
image in itemtemplate disappear when load image handler