The do-while looks fine.
Although, the getch(); should be _getch();.
See if that works.
If not, could you be more specific?
Last edited on
while (swp=2);
This line should make it infinite loop, is the program finishing, or hanging? You probably intend for it to be while (swp==2);
right thanks.
forgot that = is the assignment operator and not for conditional logic.
works now with while (swp==2);
Last edited on