According to C Standard (6.3.2.3 Pointers)
5 An integer may be converted to any pointer type. Except as
previously specified, the result is implementation-defined, might not
be correctly aligned, might not point to an entity of the referenced
type, and might be a trap representation.67)
In your code snippet
int a=10;
printf("%d", (int *)a);
pointer (int *)a
might not be correctly aligned for example when sizeof( int * ) is equal to either 4 or 8.
Also take into account that this call of printf
printf("%d", (int *)a);
has undefined behaviour,
From the C Standard (7.21.6.1 The fprintf function - the same is valid for printf)
9 If a conversion specification is invalid, the behavior is
undefined.275) If any argument is not the correct type for the
corresponding conversion specification, the behavior is undefined.
As for this code snippet
int b=516;
printf("\n %d",((char *)b));
then the compiler pushes on the stack value 516 as an address but inside function printf and due to format specifier %d
the function considers this value again as an integer object and outputs it accordingly.