MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/questions/arm_num.cpp:9–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#define endl '\n'
8
9int main(){
10 cin.tie(0)->sync_with_stdio(0);
11 int n;
12 cin>>n;
13 int temp=n;
14 int tmep2=n;
15 int sum=0;
16 int digit=0;
17 while(n!=0){
18 digit++;
19 n/=10;
20 }
21 while(temp!=0){
22 int ss=temp%10;
23 sum+=pow(ss,digit);
24 temp/=10;
25
26
27 }
28 if(sum==tmep2){
29 cout<<"it is armstrong numbr"<<endl;
30
31 }
32 else
33 cout<<"its not "<<endl;
34
35 return 0;
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected