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

Ex Input:

int cal(int M, int N)
{
    int i;
	int num=0;
	if(M==1) return 0;
	if(N>=M) return ( 1+cal(M,M-1));
	for(i=2;i<M;i++)
	{
		if(M%i==0&&i<=N) num=num+cal(M/i,i);
	}
	return num;
}
int main()
{
	int n,M;
	cin>>n;
	while(n--)
	{
		cin>>M;
		cout<<cal(M,M)<<endl;
	}
	return 0;
}



Ex Output:
1


Ex Input:
void decprime(int begain,int a);
int sum=1;
int main()
{
	int n,a;
	int k;cin>>n;
	for(k=0;k<n;k++){
		cin>>a;
		 decprime(2,a) ;
		 cout<<sum<<endl;
		 sum=1;
	}
	return 0;
}
void decprime(int begain,int a)
{
	int i;
	 //int u=int(sqrt(double(a)));
//int m[10000]={};

	//if(a==2||a==3||a==5)return 1;
	//else{
		for(i=begain;i<=a;i++){
		if(a%i==0&&i<=a/i)
		{
			sum++;
			decprime(i,a/i);
		}
		if(i>a/i)break;
			//m[i]=decprime(a/i);
		//else m[i]=0;
//sum+=m[i];
		//}
	 //return sum+1;
	 }
		}


Ex Output:
2


Ex Input:
int panduansushu(int t)
{
	int i;
	for(i=2;i<t;i++)
	{
		if(t%i==0){break;}
	}
	if(i>t/2)return 1;
	else return 0;	
}

int sum=0;
void fun(int n,int i)
{
	if(n==1)sum++;
	for(;i<=n;i++)
	{
		if(n%i==0)fun(n/i,i);
	}
}

void main()
{
	int a[100],i,res,j,n;
	scanf("%d",&n);
	for(j=0;j<n;j++)scanf("%d",&a[j]);
	for(j=0;j<n;j++)
	{
		if(panduansushu(a[j])==1)
		{
			printf("1\n");
		}
		else{ for(i=2,res=1;i<a[j]/2;i++)
		{
			if(a[j]%i==0){sum=0;fun(a[j]/i,i);res+=sum;}

		}
		printf("%d\n",res);}}
}

Ex Output:

5


