C++ Programming Code Examples C++ > Pointers Code Examples C++ Programming Code to Add Two Numbers using Pointer C++ Programming Code to Add Two Numbers using Pointer To add two numbers using pointer in C++ Programming, you have to ask to the user to enter the two number, then make two pointer type variable of same type say *ptr1 and *ptr2 to initialize the address of both the number and make another variable say sum which contain the addition of the two number like sum = *ptr1 + *ptr2 and display the result on the screen. Here * is also called as value at address operator. Following C++ program ask to the user to enter the two number and add the entered two number using pointer then display the addition result on the screen: /* C++ Program - Add Two Numbers using Pointer */ #include<iostream.h> #include<conio.h> void main() { clrscr(); int number1, number2, *ptr1, *ptr2, sum=0; cout<<"Enter the two number :"; cin>>number1>>number2; ptr1 = &number1; ptr2 = &number2; sum = *ptr1 + *ptr2; cout<<"Sum of the two number is "<<sum; getch(); }