Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Armstrong Number Program in C++, C Plus Plus CPP with Flowchart

Armstrong Number Program in C++, C Plus Plus CPP with Flowchart

In this tutorial, we will learn about the followings;

  1. Flowchart of the program of Armstrong NumberĀ 
  2. Armstrong Number Program in C++, C Plus Plus CPP
  3. Armstrong Number Program in C

Flowchart of the programĀ  of Armstrong Number with Flowchart

Armstrong Number Program in C++, C Plus Plus CPP Flow chart

Figure: Armstrong Number Program in C++, C Plus Plus CPP with Flowchart.

Armstrong Number Program in C++, C Plus Plus CPP

#include<iostream>
#include<conio.h>
using namespace std;

int main()
{
int Armstrong=0;
int o;
int q;
int w;
int y;
int number; 
cout<<"Enter Any number for Digits Armstrong: ";
 cin>>number;
y=number;
while(number>0)
{
o=number%10;
number=number/10;
Armstrong=Armstrong+o*o*o;
}
if(Armstrong==y)
{
cout<<"this is Armstrong number";
}
else
{
cout<<"this is not a Armstrong number";
}
getch();
}

Output

Armstrong Number Flow chart

Figure: Armstrong Number Flowchart.

Armstrong Number Program in C

#include<stdio.h>

int main()
{
int Armstrong=0;
int o;
int q;
int w;
int y;
int number; 
printf("Enter Any number for Digits Armstrong: ");
scanf("%d", &number);
y=number;
while(number>0)
{
o=number%10;
number=number/10;
Armstrong=Armstrong+o*o*o;
}
if(Armstrong==y)
{
printf("this is Armstrong number");
}
else
{
Printf("this is not a Armstrong number");
}
getch();
}

Output

Armstrong Number Flow chart

Figure: Armstrong Number Flowchart.