Sunday, June 6, 2021

program that calculate the sum using pointer (POP) (160)

#include<iostream>

using namespace std;

int main()

{

int a=10,b=20,sum;

int* ptr1;

int* ptr2;

ptr1=&a;

ptr2=&b;

sum= *ptr1+ *ptr2;

cout<<"the sum is:"<<sum<<endl;

} 

No comments:

Post a Comment