Submission #5307567( included both iostream and math.h header file)

#include <iostream.h>
#include <math.h>

using namespace std;

int digit(int n){
int digit{0},i{0};
while(n=!0){
digit=n%10;
n=n/10;
i++;}
return i;
}
int armstrong(int n,int a)
{
int digit{0},sum{0};
while(n=!0){
digit=n%10;
sum=sum+pow(digit,a);
n=n/10;
}
return sum;
}

int main()
{
int n{0},i{0};
cin<<n;
i= digit(n) ;
cout>>armstrong(n,i)>>endl;
return 0;
}

@Shubham_helloworld
#include is enough you dont need to add .h

but why is it showing error

because library is iostream, not iostream.h, if there are other errors as well i’d suggest you to share code via ide.codingblocks.com

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.