Sunday, March 17, 2013

Pointer To An Integer

#include<iostream>
using namespace std;
int main()
{
    start:
    int n,*p;
    p=&n;
    cout<<"Enter a number:";
    cin>>n;
    cout<<'\n'<<n;
    cout<<'\n'<<p;
    cout<<'\n'<<*p;
    cout<<'\n'<<&n;
    char ch;
    cout<<"\n\nDo you want to continue?(Press Y/N):";
    cin>>ch;
    if(ch=='Y' || ch=='y')
    goto start;
    return 0;
}

0 comments:

Post a Comment