Hi ..
I need help regarding writing a C code for a random delay that its duration is within 0.2 - 0.8 miliSeconds?
Are we expected to submit some random lines of code?
You have to realize that you can't implement a random function unless you have any data somewhere to randomize from. You (!) have to figure out where that data can come from (# of received serial characters, time stamps when they where received, ...).
We can't do such things - we don't even know your platform...
As soon as you have figured out where you can get something random to base the delay on, then it should be trivial for you to implement the actual delay. Once more: Implementing a delay requires knowledge about the platform. We don't know what timers are available, or how fast the processor is if the delay should busy-loop...
Note that 'C' (or any other High-Level Language, for that matter) is not suitable for writing busy-loop delays for any specific duration as you have absolutely no control whatsoever over what specific instructions the compiler might choose to implement the loop - nor, in fact, whether that choice might change on subsequent compilations...
"Are we expected to submit some random lines of code?"
even if we did, it wouldn't give you a random delay - as Per says, every time you ran them, you would get the same delay!