How to write latex symbol not equal : \neq

How to write latex symbol not equal : \neq

Not equal symbol in Latex is the command: \neq

$$x \neq y$$

which gives:

\[x \neq y\]

Examples

Here are few examples:

$$A \neq B$$
\[A \neq B\]
$$\{x_1\} \neq \{x_1,x_2\}$$
\[\{x_1\} \neq \{x_1,x_2\}\]