for(i=1;i<=n;i++){
---------------------------loop1
j=n;
if(i%2==0)
while(j>1)
----------------------------loop2
{
j=j/2;
}
}
Loop1 :runs for 'n' times.
Loop2 : Start with j=n then n/2 then n/4 .........1
So n,n/2,n/4,n/8........1 i.e logn times.
hence Exact Time complexity= 1 + logn + 1 + logn +1 +logn .........
i.e (n/2)*logn + n/2
=(nlogn)/2
So O(nlogn) Hence D is Correct Option.