Current location - Education and Training Encyclopedia - University rankings - University C language problem: Sort by pointer, please use the program to sort two integers from small to large with pointer variables?
University C language problem: Sort by pointer, please use the program to sort two integers from small to large with pointer variables?
# include & ltstdio.h & gt

int main () {

// TODO, please write the code here to complete the requirements of the topic.

int a,b,t;

int *p,* q;

p = & ampa;

q = & ampb;

scanf("%d%d ",p,q);

if(* p & gt; * Q)

{ t = * p;

* p = * q;

* q = t; }

printf("%d %d ",*p,* q);

Returns 0;

}

Submitted tank