Computer Science, asked by Nousher, 11 months ago

#include <stdio.h>
int main()
{
int i,j,n,cn,r,s;
long long f;
printf("enter n values:\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
cn=i;
s=0;
while(cn>0)
{
r=cn%10;
f=1;
for(j=1;j<=r;j++)
{
f=f*j;
}
s=s+f;
cn=cn/10;
}
if(s==i)
printf("%d\n",s);
}
return 0;
}
output????​

Answers

Answered by Anonymous
3

Answer:

actually it will give error since you cannot give a "return " value in int main. Infact "main" can never be written as 'int' it should be written as "void main".

Explanation:

hope it helps... please mark me as a brainliest

Similar questions