Completely Solved C, C++ Programs Assignment.




C Program to accept a number and check the given number is Armstrong or not.(Process I)

Filed Under:

Problem 9: C Program to accept a number and check the given number is Armstrong or not.(Process I)
#include<stdio.h>
#include<conio.h>
main( )
{
int n, a, b, c, d;
clrscr( );
printf (“ Enter a Three Digit Number: “);
scanf (“%d”, &n);
a=n/100;
b=((n/10)%10);
c=n%10;
d=a*a*a*+b*b*b +c*c*c;
if (n= =d)
printf (“The Given Number is Armstrong number”);
else
printf (“The Given Number is Not Armstrong number”);
getch( );
}
Process II with Solved Assignments
C compiler: gcc 4.1.2

Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments