一、流程图

交换两个变量的值_#include


二、代码

#include <stdio.h>
int main()
{
int a, b, t;
a = 1, b = 2;
t = a;
a = b;
b = t;
printf("交换后的a=%d\n交换后的b=%d\n", a,b);
return 0;
}

三、执行结果

交换两个变量的值_c语言_02