Chapter:

C-programs-on-various-integers

C Program to Check wher 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 <stdio.h>

#include <math.h>

 

void main()

{

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

 

    printf ("enter a number");

    scanf("%d", &number);

   &....Show More

All Chapters

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