Teacher:This task is to find the number of 'For' loops present in the given cpp program.
Teacher: Now, understand the problem? Solve this instance: int f(int a,int s)
{
int y=0;
for (;s<=a;s++)
{
if (s==a)
y+=1;
else if (s>1&&a%s==0)
y+=f(a/s,s);
}
return y;
}
main ()
{
int n,i,a;
scanf ("%d",&n);
for (i=0;i<n;i++)
{
scanf ("%d",&a);
printf ("%d
",f(a,1));
}
}
Student:
2