how to optimize this code in c?
The first question is always why do you need to optimize it?
What are the values of j and k when that code has run?
You are optimizaing this loop because you ran a profiler and too much time is being spent there, right?
Otherwise DON'T optimize.
We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.