This task is to find the number of 'For' loops present in the given cpp program.

Ex Input:
void factor(int x,int limit);
int result;
int main()
{
int n;
scanf("%d",&n);
int input;
for(int i=0;i<=n-1;i++)
{
scanf("%d",&input);
result=1;//limit?2?????result=1;
factor(input,2);//limit?2?????result=1;
printf("%d
",result);
}
return 0;
}
void factor(int x,int limit)
{
int remainder;
if(x<limit)
{
return;
}
for(int i=limit;i<=x;i++)
{
remainder=x%i;
if(remainder==0)
{
if(x/i>=i)
{
result++;
factor(x/i,i);
}
}
}
}

Ex Output:
2

Ex Input:

int kind (int k,int a)
{
int i,j,temp=0;
int x;
for (i=a;i<k;i++)
{
if (i<=k/i&&k%i==0)
{

x=k/i;
// printf("%d*%d=%d
",x,i,k);
temp++;
for (j=i;j<x;j++)
{
if (j<=x/j&&x%j==0)
{
temp=temp+kind(x,j);
break;
}

}

}
}

return (temp);
}
int main ()
{
int n,i,s,a[32768][2];
scanf("%d",&n) ;
for (i=0;i<n;i++)
{
scanf("%d",&a[i][0]);
a[i][1]=kind(a[i][0],2);
}
for (i=0;i<n;i++)
{
printf("%d
",a[i][1]+1);//k=k????
}
//scanf("%d",&n) ;
return 0;
}

Ex Output:
4

Ex Input:
int main()
{
int i,j,num[100],n,m;
int fj(int ,int );
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&num[i]);
for(i=1;i<=n;i++)
printf("%d
",fj(2,num[i]));

return 0;
}

int fj(int k,int n)
{
int c,i,sum=1;
if(n==2) return(sum);
else if(n==3) return(sum);
else
{
c=(int)sqrt(n);
for(i=k;i<=c;i++)
if(n%i==0) sum=sum+fj(i,n/i);
return(sum);
}
}

Ex Output:
3