C++ program of adding two numbers using pointers with OOP


 

#include<iostream>

using namespace std;


//Function of Addition

void sum()

{

int a,b,sum=0;

int *p1,*p2;

cout<<"Enter Two Numbers:"<<endl;

cin>>a>>b;

p1 = &a;

p2 = &b;

sum = *p1 + *p2;

cout<<"Sum Of Two Numbers Are:"<<sum<<endl;

}


int main()

{

    void sum();

    

    return 0;

}

No comments:

Post a Comment

Internet Celebrity Shaam Idrees & his wife Sehar aka Froggy decided to live separately

Famous YouTuber Sham Idris and his wife Sahar aka Froggy have decided to live separately for some time. Sham Idris informed his fans on soci...