Day#75 'C' Coding Challenge

Day#75 'C' Coding Challenge

Which among the below usage is recommended?

x = 20; x ++; printf("%d",x);

or 

x = 20; x =x+1; printf("%d",x);

--------------------------------------------------

The compiler treats x++; as a instruction and is executed within a cycle.

x= x+ 1 takes more than one cycle for execution.

Wherever increment is involved, considering the evaluation sequence of the expression, x++ saves execution time.

Post a Comment

0 Comments