Login to ask a question from C programs on various integers

C Program to Check whether a given Number is Armstrong:

This is a C Program to check whether a given number is armstrong.

Problem Description

This C Program checks whether a given number is armstrong number.

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 Check whether a given Number is Armstrong

 */

#include

#include

 

void main()

{

    int number, sum = 0, rem = 0, cube = 0, temp;

 

    printf ("enter a number");

    scanf("%d", &number);

    temp = number;

    while (number != 0)

    {

        rem = number % .... Show More

Previous Question Next Question
🔗

Similar Questions

From C programs on various integers · C programming

View All
WhatsApp