output is not coming,but if i<x condition is there then only last element is not present.
@vipin.kumar The output is coming correct for the code which you have shared.