C-Program to find biggest among two numbers using pointers.
#include<stdio.h>
#include<conio.h>
int main()
{
int a, b, *big, *xptr, *yptr;
printf("\nEnter two numbers:\n");
scanf("%d%d",&a,&b);
xptr = &a;
yptr = &b;
if(*xptr > *yptr)
big = xptr;
else
big = yptr;
printf("\nBiggest Number is %d\n\n4",*big);
}
#include<stdio.h>
#include<conio.h>
int main()
{
int a, b, *big, *xptr, *yptr;
printf("\nEnter two numbers:\n");
scanf("%d%d",&a,&b);
xptr = &a;
yptr = &b;
if(*xptr > *yptr)
big = xptr;
else
big = yptr;
printf("\nBiggest Number is %d\n\n4",*big);
}
OUTPUT:
0 Comments