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

Input: Consider Input: 
int fg(int k,int m)
{
    int j,d=0;
	if (m==1)
	{
       d=1;
	}
   	for(j=k;j<=m;j++)
	{
		if (m%j==0)
			d=d+fg(j,m/j);
	}
	return(d);
}

int main()
{
	int n,i,a[40000],b[40000],s;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=1;i<=n;i++)
	{
		b[i]=fg(2,a[i]);
		printf("%d\n",b[i]);
	}
	return 0;
}

Output: 3


Input: Consider Input: int sum=1;
void f(int i,int j)
{
	int k;
	if(i==1)
	    sum++;
	else
	{
		for(k=j;k<=i;k++)
		{
			if(i%k==0)
				f(i/k,k);
		}
	} 
}
int main(void)
{
	int i,j,k;
	int n;
	int a;
	scanf("%d",&n);
	while(n--)
	{
		sum=1;
		scanf("%d",&a);
		for(i=2;i*i<=a;i++)
		{
			if(a%i==0)
			{
				f(a/i,i);
			}
		}
		printf("%d\n",sum);
	}
	return 0;
}

Output: 2


Input: Consider Input: int func(int m,int q)
{
	int b[100];
	
	int i,j,k=0,p=0,sum=1;
	for (j=q;j<=m;j++)
	{
		if (j*j>m)
		{
			p=k;
			break;
		}
		if (m%j==0)
		{
			b[k]=j;
		    k++;
		}
		
	}
	if (k>2||p!=0&&m!=2)
	{
		for (i=0;i<p;i++)
		{
			sum+=func(m/b[i],b[i]);
		}
		return (sum);
	}
	else
		return (1);
}
main()
{
	int i,j,k=0,n,m,b[100]={0},a[100]={0};
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&m);
	    b[i]=func(m,2);
	}
	for (j=0;j<i;j++)
	{
		printf("%d\n",b[j]);
	}
}


Output: 4