I have just started learning C and a question has bugged me for a while now. If I write
int i = -1;
unsigned int j = 2;
unsigned int k = -2;
<
What is the type of integer literal -1 and 2 and -2, and how does it gets convert to get stored in signed int and unsigned int?
The C parser/compiler, as previously said by chux, "understands" your literal as a signed integer - always. They are then casted to fit in the variable you assign to, which can be of different type. Doing this, some bits can be lost or they can change their meaning (for example, assigning a negative value to an unsigned int). Some compiler could warn you about a "literal out of range", other compilers could silently accept (and truncate) your literals.
What Do You Mean By Signed Integer, is that the property of variable or integer literal too , like -2 is signed integer and 2 is unsigned integer.?
It is a property of the variable. In reality, it is a "type" - written as a "two words" identifier.