Write a program to find that the numbers is Armstrong or not | CODE WITH SHARAD

Write a program to find that the numbers is Armstrong or not

Written by Sharad Raj on 13th of March, 2018

BASIC PROGRAMS   C LANGUAGE PROGRAMS

PROGRAM CODE

#include<stdio.h>

#include<conio.h>

void main()

{

int number,a=0,rem,num;

clrscr();

printf("Enter the number : ");

scanf("%d",&number);

num=number;

while(number>0)

{

rem=number%10;

a=a+(rem*rem*rem);

number=number/10;

}

if(num==a)

printf("%d is an Armstrong number",num);

else

printf("%d is not an Armstrong number",num);

getch();

}


Comments


Contact