answersLogoWhite

0

class Armstrong{ public static void main(String args[]) { int num,rem,qub,sum=0,i; for(i=0; i<=999; i++) { num=i; sum=0; while(num>0) { rem=num%10; qub=rem*rem*rem; sum=sum+qub; num=num/10; } if(sum==i) { System.out.println("Print 1 to 1000 Armstrong Number",sum); } } } }

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?


Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i &lt;= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.


What are all the whole numbers between 1 to 1000000000?

All of the whole numbers between one and a billion. Honestly, we're not robots here. Write a program and do it yourself, if you really need them.


Write a program in Lex to eliminate white space and collect numbers as a token?

write a lex program to delete space from the program


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


How do you write code for 1 to 500 Armstrong number in socket programming?

To write code for finding Armstrong numbers between 1 and 500 using socket programming, you would first create a server that listens for client connections. Upon receiving a request, the server would compute Armstrong numbers in that range by checking if the sum of the cubes of their digits equals the number itself. The server then sends the list of Armstrong numbers back to the client. The client can be a simple script that connects to the server and displays the received numbers. Here's a basic outline: Set up a server socket to listen for connections. Upon connection, calculate Armstrong numbers using a loop and send the result back. On the client side, connect to the server and print the received Armstrong numbers.


Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html


How do you write a program in objective c numbers 1-100 prime numbers?

fdsgfhgdfhgdf


Could you Write a program for 8086 microprocessor that displays on the monitor the average of 2 numbers from an array?

How to write a program for mouse in microprocessor?


Write a program to print even and odd numbers in between 1 to 10?

for (int i = 2; i < 10; i ++) printf("%d\n", i); You did say even and odd numbers between 1 and 10. That's allnumbers between 1 and 10.


Write a Program in c to find palindrome numbers between any two numbers?

please somebody should help me answer this question..I have a project on it even! It seems almost impossible at the moment.


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers