Chapter:

C-programs-on-various-integers

C Program to Print Armstrong Number from 1 to 1000

This is a C Program to print armstrong number from 1 to 1000.

Problem Description

This C Program print armstrong number from 1 to 1000.

Problem Solution

An Armstrong number is an n-digit base b number such that the sum of its (base b) digits raised to the power n is the number itself. Hence 153 because `1^3 + 5/3 + 3^3 = 1 + 125 + 27 = 153.`

Program/Source Code

/*

 * C Program to Print Armstrong Number from 1 to 1000

 */

#include <stdio.h>

 

main()

{

    int number, temp, digit1, digit2, digit3;

 

    printf("Print all Armstrong numbers between 1 and 1000:\n");

    number = 001;

    while (number <= 900)

&n....Show More

All Chapters

View all Chapter and number of question available From each chapter from C-programming-