Nope, you're getting garbage, because, in the
printf
calls there are
two %d
format specifiers while only
one value (
*(&k)+*(&l)
) is provided.
Try
#include <stdio.h>
int main()
{
int k=2, l=5;
printf("add of k+l is %d\n",*(&k)+*(&l));
return 0;
}
Note, you could have made it simpler
#include <stdio.h>
int main()
{
int k=2, l=5;
printf("add of k+l is %d\n", k+l);
return 0;
}