Pointers are very important in programming and dynamic memory allocation can't be performed without them. Pointer is also a variable and it used to store the memory address of the others variable.
Source Code
#include<iostream> using namespace std; int main () { int num1,num2,sum,*n1,*n2; cout<<"\t \t \t LEP Tutorials\n \n \n"; cout<<"Enter Your First Number : "; cin>>num1; cout<<endl; cout<<"Enter Your Second Number : "; cin>>num2; n1 = &num1; n2 = &num2; sum = *n1 + *n2 ; cout<<endl; cout<<"The Sum Through Pointers is : "<<sum<<endl; }
0 comments:
Post a Comment