0

Can anyone please help me "Printing strong numbers in the given range in c".

7th Jun 2020, 11:43 AM
Mani Sankar
Mani Sankar - avatar
2 Answers
+ 1
Please show the code with which you have a problem. And state your question more precisely, what is the specific issue here?
7th Jun 2020, 11:45 AM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
0
Please make corrections for this code- #include<stdio.h> int main() { int n,i,j,min,max,r,sum=0,temp,fact; printf("minimum range:",&min); scanf("%d",&min); printf("maximum range:",&max); scanf("%d",&max); temp=n; printf("strong numbers in the given range are:"); for(i=min;i<=max;i++) { while(n>0) { sum=0; temp=i; r=n%10; fact=1; for(j=1;j<=r;j++) { fact=fact*i; } sum=sum+fact; n=n/10; } } i=temp; if(sum==i) printf("%d",i); return 0; }
7th Jun 2020, 2:05 PM
Mani Sankar
Mani Sankar - avatar