Re: can anybody help me in writing........................................... .......
Actually the proper way to apply accurate delay is by using timers.
honey 77 has provided an example of that targeted to a CortexM based cpu (he has deleted the post apparently) but the problem is that the OP has not provided enough info on the mcu he intends to use, vendor and model
For a generic delay milind.a.kulkarni routine would work but you can never be sure of the delay you'll get after the code gets compiled.
I would add that a volatile variable should be used for the loop to make sure that the compiler doesn't optimize (remove) the loop