is it necessary to write C=E(K,P), Can we write C=E(P,K)? I just want to know that can we write encryption and decryption formula like
$C=E(P,K)$ instead of $C=E(K,P)$
Personally I keep to what I do during development: the variable that is most static is to the left, the more dynamic ones to the right. So I use key, IV and input in that particular order.

A cipher is a keyed permutation, often written as $\text{E}_K$, so in my opinion $\text{E}(K, M)$ is closest to $\text{E}_K(M)$. Writing the parameters in a different order is not as nice. But as in any mathematical function, it is up to you to define it.

As Geoffroy said, if it is made clear then you can certainly get away with it. But I still would keep to the most common order if just to avoid confusion.



Oh, I just noticed that you use $P$ for "plaintext" while I use $M$ for "message", but that's really not much of an issue in my opinion.