Monday, 24 December 2012

Checking if a number is Armstrong number:


The program for Checking if a number is Armstrong number:

//Armstrong Number:: abc==a3+b3+c3
#include<stdio.h>
#include<conio.h>
void main()
{
int input,s=0,a,b;
clrscr();
printf("Enter the number you want to check:");
scanf("%d",&input);
a=input;
while(a!=0)
{
b=a%10;
a=a/10;
s=s+(b*b*b);
}
if(s==input)
{
printf("Yes! %d Is a Armstrong Number.",input);
}
else
{
printf("No! Its not a Armstrong number");
}
getch();
}

the output is like:


2 Responses to “Checking if a number is Armstrong number:”

Partha Roy said...
30 May 2013 at 00:20

what a program... excelent work thanks bro...


Anonymous said...
3 April 2022 at 19:12

Merkur 15c Safety Razor - Barber Pole - Deccasino
Merkur 15C https://septcasino.com/review/merit-casino/ Safety Razor - Merkur - 15C for 1xbet 먹튀 Barber Pole is the perfect introduction https://deccasino.com/review/merit-casino/ to the https://febcasino.com/review/merit-casino/ Merkur Safety worrione Razor.


Post a Comment

Recent Comments

All Rights Reserved Assignments on C language