C Program to Add Two Numbers using Pointers

 

#include<stdio.h>
#include<conio.h>
void main()
{
int x,y,add, *xptr,*yptr;
clrscr();
printf("Enter the value of x and y :");
scanf("%d%d",&x,&y);
xptr=&x;
yptr=&y;
add=*xptr+*yptr;
printf("The addition is %d", add);
getch();
}

 

 

Output:

C Program to Add Two Numbers using Pointers