@gauravkc
inner loop j not always executing 4 times only for n=2,4,6,8....means all even numbers after 0 execute for 4 times...i.e it will execute in total...4* (n/2)
now for odd terms i.e 5,7,9,11.... it execute for 5 times for 3 only it executes 6 times...so overall time is complexity is O(n) only..
(as i integer it will take only int value in case when i is odd when you divide you dont get int values..so there is difference in number of times loop is executing for different i values..)
correct me if i am.wrong.