Where is the problem in my code Strange root?
In Strange root challenge,when I input 7 the output should true. but it show false. I can't fix this. Someone help plz. As I used array first time. #include <stdio.h> #include<math.h> int times(int n); int main() { Ā Ā Ā int n,s,p,r,i,r1,r2,z,m; Ā Ā Ā double st,d; Ā Ā Ā scanf("%d",&n); Ā Ā Ā printf ("Input: %d",n); Ā Ā Ā s=n*n; Ā Ā Ā st=sqrt(n); Ā Ā Ā printf ("\nSquare: %d",s); Ā Ā Ā int intpart=(int)st; Ā Ā Ā double decpart=st-intpart; Ā Ā Ā d=decpart*1000; Ā Ā Ā int intpart2=(int)d; Ā Ā Ā p=intpart2; Ā Ā Ā i=100; Ā Ā Ā do Ā Ā Ā { Ā Ā Ā Ā Ā Ā Ā r=p%i; Ā Ā Ā Ā Ā Ā Ā i/=10; Ā Ā Ā Ā Ā Ā Ā if(r==0) Ā Ā Ā Ā Ā Ā Ā p/=10; Ā Ā Ā Ā Ā Ā Ā else Ā Ā Ā Ā Ā Ā Ā continue; Ā Ā Ā }while(r==0); Ā Ā Ā printf ("\nSquared first 3 digit: %d",p); Ā Ā Ā m=times(p); Ā Ā Ā z=times(s); Ā Ā Ā int sq[z],sqt[m]; Ā Ā Ā do Ā Ā Ā { Ā Ā Ā Ā Ā Ā Ā r2=s%10; Ā Ā Ā Ā Ā Ā Ā scanf("%d",&sq[r2]); Ā Ā Ā Ā Ā Ā Ā s/=10; Ā Ā Ā }while(s>0); Ā Ā Ā do Ā Ā Ā { Ā Ā Ā Ā Ā Ā Ā r1=p%10; Ā Ā Ā Ā Ā Ā Ā scanf("%d",&sqt[r1]); Ā Ā Ā Ā Ā Ā Ā p/=10; Ā Ā Ā }while(p>0); Ā Ā Ā if(sq[r1]!=sqt[r2]) Ā Ā Ā printf("\nNo strange https://code.sololearn.com/cfriNFAXiZT7/?ref=app