Search This Blog

Translate

find maximum number from two numbers by using pointer

c program to find maximum number from two numbers by using pointer


#include"stdio.h"
#include"conio.h"
void main()
{
int a,b,*p1=&a,*p2=&b;
clrscr();
printf("\nEnter first number=");
scanf("%d",p1);
printf("\nEnter second number=");
scanf("%d",p2);
if(*p1"*p2)
{
printf("\n\n%d is maximum number.",*p1);
}
else
{
printf("\n\n%d is maximum number.",*p2);
}
getch();
}

c program to find maximum number from two numbers by using pointer


C Program example List

Google+ Badge