Pointer Program - Insurance Tips

A Hub of Best Guide Health Insurance Tips

Saturday, March 28, 2020

Pointer Program

#include
#include
using namespace std;

int main()
{
    int a, b, *ptr1, *ptr2;
    a=10;
    b=20;
   
    ptr1=&a;
    ptr2=&b;
   
    cout<<"The value of a and b is: "<    cout<<"Thier value using address is: "<<*ptr1<<" and "<<*ptr2<    cout<<"Their sum using address is: "<<*ptr1+*ptr2<    cout<<"Their address is: "<<&ptr1<<" and "<<&ptr2<   
    getch();
}

No comments:

Post a Comment