ARMSTRONG NUMBER OR NOT

1.  #include<stdio.h>
2.  #include<conio.h>
3.  void main()
4.  {
5.  int s=0,n,d,c,t;
6.  clrscr();
7.  printf("\n\tEnter Any Number ");
8.  scanf("%d",&n);
9.  printf("\n\tInput Number = %d",n);
10.t=n;
11.while(n!=0)
12.{
13.d=n%10;
14.c=d*d*d;
15.s=s+c;
16.n=n/10;
17.}
18.printf("\n\tCube Sum of each 
Digit Number = %d",s);
19.if(t==s)
20.{
21.printf("\n\tArmstrong Number");
22.}
23.else
24.{
25.printf("\n\tNot Armstrong Number");
26.}
27.getch();

28.}
Output

No comments:

Post a Comment

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II :   1) Which of the following is the extension of Not...