Part 1. Definition
This task is to find the number of 'For' loops present in the given cpp program.
Part 2. Example
main()
{
      float a[4];
      float k;
      float c;
      int i;
      for(i=0;i<4;i++)
      {
                      scanf("%f",&a[i]);
      }
      scanf("%f",&c);
      c=2*3.1415926*c/360;
      k=(a[0]+a[1]+a[2]+a[3])/2;
      double s,sq;
      sq=(k-a[0])*(k-a[1])*(k-a[2])*(k-a[3]) - a[0]*a[1]*a[2]*a[3]*(double)cos(c/2)*(double)cos(c/2);
    
      if(sq<0)
      printf("Invalid input");
      else
      {
          s=sqrt(sq);
          printf("%.4f",s);
      }
    
}

Answer: 1
Explanation: The number of 'for' loops in the code is given by the number of 'for' string present in the code. Since we can find the exact number of for loops, this is a good example.
Part 3. Exercise
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\n",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);
			}
		}
	}
}
Answer:
2