Well, my best friend was shortlisted for Microsoft Recruitment Test via Amcat. He is very good in academics and is currently dwelling deep into android world. Well, we are still expecting a positive result. In the test, he was given two programs, one of which was a pattern, and, other was to insert an element into an sorted circular list. Well, For many days, it was in my mind to make this program, so I finally set out to make it. Here it is. In the program I have assumed that the list may or may not be sorted, so I had to sort the list by my own in the first place.

I am using eclipse Juno and MinGW compiler at the core, and I do not know why it is facing some problem in executing printf and scanf statements in the sequential order. The assumed soltuion is to add a “fflush(stdout);” statement next to printf statement. The statement does what it looks to do, it flushes the output stream buffer. If you are going to use some other compiler/IDE, I think you wont be needing that statement. Well, here is the program. Continue reading