#include <stdio.h>
int main()
{
int func(int *p1, int *p2, int *p3);
int a, b, c;
int *pointer_1 = &a;
int *pointer_2 = &b;
int *pointer_3 = &c;
printf ("enter a b c:");
scanf ("%d %d %d", &a, &b, &c);
func(pointer_1, pointer_2, pointer_3);
printf("%d %d %d",*pointer_1, *pointer_2, *pointer_3);
return 0;
}
int func(int *p1, int *p2, int *p3)
{
int func1 (int *z1, int *z2);
if (*p1 < *p2)
{
func1(p1, p2);
}
if (*p1 < *p3)
{
func1(p1, p3);
}
if (*p2 < *p3)
{
func1(p2, p3);
}
return 0;
}
int func1(int *z1, int *z2)
{
int temp;
temp = *z1;
*z1 = *z2;
*z2 = temp;
return 0;
}
int main()
{
int func(int *p1, int *p2, int *p3);
int a, b, c;
int *pointer_1 = &a;
int *pointer_2 = &b;
int *pointer_3 = &c;
printf ("enter a b c:");
scanf ("%d %d %d", &a, &b, &c);
func(pointer_1, pointer_2, pointer_3);
printf("%d %d %d",*pointer_1, *pointer_2, *pointer_3);
return 0;
}
int func(int *p1, int *p2, int *p3)
{
int func1 (int *z1, int *z2);
if (*p1 < *p2)
{
func1(p1, p2);
}
if (*p1 < *p3)
{
func1(p1, p3);
}
if (*p2 < *p3)
{
func1(p2, p3);
}
return 0;
}
int func1(int *z1, int *z2)
{
int temp;
temp = *z1;
*z1 = *z2;
*z2 = temp;
return 0;
}