Difference between assigment and equalto

= is used for assignment to assign some value for example

int i

i=9;

on the other hand == is used for comparing some values

if(i==9)