Not printing front element

showing incorrect output

see in the main( ) last line

Hello @amit0001 please share your code by saving it on ide.codingblocks.com .
i will check your code:

Hello @amit0001 you are little confused here:
this is happening becuase you are taking mod here with ms in pop function and during that when all the elements are popped then after that front will go to zero because of mod.
as we are not deleting the elements from the array we are just hypothetically handeling the elements in the array by manipulating front. so by giving the front value in the range of ms it will give us values.
when you doing pop you are just incrementing the front which will then be used as indexing in the array and then print the next element.
hope this explains you.
if you still have any doubt you can ask here;
Happy Learning!!

got it !

@amit0001 if you feel that your query is cleared you can mark this as resolved.
Happy Learning!!