sorry, it's still wrong. Again, count the number of times the inner loop cycles ( no, it's not 1 nor 2^n. try following the code as it runs, eventually with a debugger or just with pen and paper ).