- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Programs for practice
C++ Program to Add Two Numbers using Pointer
Source Code: Add Two Numbers using Pointer
/* C++ Program - Add Two Numbers using Pointer */ #include<iostream.h> #include<conio.h> void main() { clrscr(); int num1, num2, *ptr1, *ptr2, sum=0; cout<<"Enter the two number :"; cin>>num1>>num2; ptr1 = &num1; ptr2 = &num2; sum = *ptr1 + *ptr2; cout<<"Sum of the two number is "<<sum; getch(); }Output
Enter the two number : 6 8 SUm of the two number is : 14