c/c++语言开发共享C语言实现 用函数实现两个数的交换

#include <stdio.h> #include <stdlib.h> int main() { int a, b; int change_num(i

  #include <stdio.h>  #include <stdlib.h>  int main()  {   int a, b;   int change_num(int a, int b);//声明change_num函数   printf("please enter two numbers:");   scanf("%d,%d", &a, &b);   change_num(&a,&b);//调用change_num函数   printf("%d %dn", a, b);   system("pause");   return 0;  }  int change_num(int *px, int *py)//定义change_num函数  {   int temp;   temp = *px;   *px = *py;   *py = temp;  }

 

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/c-cdevelopment/606560.html

(0)
上一篇 2021年5月14日
下一篇 2021年5月14日

精彩推荐