#include<iostream>
using namespace std;
void largest_num()
{
int x,y;
int *large,*p1,*p2;
cout<<"Enter Two Numbers:"<<endl;
cin>>x>>y;
p1 = &x;
p2 = &y;
if(*p1 > *p2)
{
large=p1;
}
else
{
large=p2;
}
cout<<"Largest Number Is:"<<*large<<endl;
}
int main()
{
largest_num();
return 0;
}

No comments:
Post a Comment