Code:
Question # 1 Solution
y=0; //Initialize y=0
x=0; //Initialize x=0
for (i=n; i>0;i=i-1) // This loop will run approximately n times
{ y=y+1;} // The loop will run approximately n times and add the value of 1 in y.
for (i=1;i<=n;i=i*3) //This statement will run approximately 2n-1 times.
{ //First loop Start
for (j=1;j<=3n;++j) // In the nested loop, The variable j depends upon the value of 3n.
{ //Second loop Start
for(k=0;k<n; k=k+5) //In the nested loop again, The statement will run n/5 times
{ //Third loop Start
x=x+5; // The statement add 5 in the X variable.
} //Third loop close
} //Second loop close
} //First loop close