#include <stdio.h>
#include <stdlib.h>
// using '*' to return pointer variable
int *addition();
int main()
{
int *ptr;
ptr = addition();
printf("*ptr = %d\n", *ptr);
system("pause");
return 0;
}
// using '*' to return pointer variable
int *addition()
{
int a, b;
int *xadrs;
xadrs = &a;
printf("enter 2 integers: ");
scanf("%d %d", &a, &b);
a = a+b;
// xadrs points to the address of int variable a
return xadrs;
}