answersLogoWhite

0

#include<stdio.h>

int main(){

int num,r,sum,temp;

int min,max;

printf("Enter the minimum range: ");

scanf("%d",&min);

printf("Enter the maximum range: ");

scanf("%d",&max);

printf("Armstrong numbers in given range are: ");

for(num=min;num<=max;num++){

temp=num;

sum = 0;

while(temp!=0){

r=temp%10;

temp=temp/10;

sum=sum+(r*r*r);

}

if(sum==num)

printf("%d ",num);

}

return 0;

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Write a java program to check a number is Armstrong number?

import java.io.*; public class Jerry { public static void main(String as[]) throws IOException { int k=Integer.parseInt(as[0]); int n=k; int d=0,s=0; while(n&gt;0) { d=n%10; s=s+(d*d*d); n=n/10; } if(k==s) System.out.println("Armstrong number"); else System.out.println("not Armstrong number"); } }


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


2 Write a program to convert a 2-digit BCD number into hexadecimal?

WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL


How do you write a Java program to see whether a number is Armstrong or not... using Buffered Reader and stuff ....?

import java.io.*; class Armstrong { public static void main()throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter a number"); int a=Integer.parseInt(in.readLine()); int n1=a,rev=0,d=0; while(a!=0) { d=a%10; rev=rev+d*d*d; a=a/10; } if(rev==n1) System.out.println("It is a armstrong number "); else System.out.println("It is not a armstrong number "); } }


Write a program which takes any number of days from the user the program should display the number of years number of months formed by these days as well as the remaining days?

Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


How do you write steven Armstrong in Arabic?

Steven Armstrong = &#1587;&#1578;&#1610;&#1601;&#1606; &#1575;&#1585;&#1605;&#1587;&#1578;&#1585;&#1608;&#1606;&#1594;


Write a C program to convert hexadecimal number into decimal number?

pongada punda vayanungala ..................


A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.

Trending Questions
What should be done after a stress cone is installed on a high voltage conductor termination? What are 3 types of opposition to current flow that impedance represents? Should you pour a concrete sidewalk without crushed stone? Can any one of you please suggest which materials are to be prepared for basic mechanical engineering? What are the common errors in shell scripting associated with for loop? What are the various turning operations that can be performed and the shapes and types of tooling that can be used (such as solid speed tooling? What is the difference between P and BR tag? How much voltage does a battery produce? How do you change font size default in tvs msp 250 star printer? Who is the real frank barnes engineer? When a multi dimensional array is passed to a function how are formal argument declaration written? Name different ways of joining metals? How can you tell if a pipe fitting is cast or ductile iron? What can be used to reduce the amount of voltage drop across the branches of a parallel circuit to be less than source voltage? Some technologies like vertical farming have a number of negative effects Which is a negative outcome of this technology? Why won't lotro load? What is meant by open circuit voltage and arc voltage? What is the importance of water supply system? What are the effect of over tightening the compression fitting? If resistor X has the same length and is made of the same material as resistor Y but has twice the diameter. Resistor X has the blank resistance of resistor Y?