单选题:以下四个程序中不能对两个整型值进行交换的是(  )。

  • 题目分类:C语言
  • 题目类型:单选题
  • 号外号外:注册会员即送体验阅读点!
题目内容:
以下四个程序中不能对两个整型值进行交换的是(  )。 A.#include<stdi0.h>
void swap(int。P,int+q)
( int*t,a;
t=&a;*t=*P;*p=*q;*q=*t;
)
main()
{ int a=10,b=20;
swap(&a,&b);printf(”%d%dkn”,a,b);
)
B.#include<stdio.h>
void swap(int*p,int*q)
{ int t;
t=*P;*P=*q;*q=t;
}
main()
{ int a-10,b-20;
swap(&a,&b);printf(”%d%d\n”,a,b);
)
C.#included stdi*.h>
void swap(int*P,int*q)
{ int t;
t=*P;*P=*q;*q=t;
)
main()
{ int*a,*b;
*a=10,*b=20:
swap(a,b);printf(”%d%d\n”,*a,*b);
)
D.#include<stdio.h>
void swap(int*P,int*q)
( int t;
t=*P;*P=*q;*q=t;
)
main()
{ int a=10'b=20,*x=&a,*y=&b;
swap(x,y);print{(”%d%d\n”,a,b);
)

参考答案:【答案仅供学习,请勿对照自行用药等】
答案解析:

有以下程序:#include<stdi0.h>main(){ int x,i;for(i=1:i<=100:i++){

有以下程序:#includemain(){ int x,i;for(i=1:i<=100:i++){ x=i:if(++x$2==

查看答案

有以下程序:#include<stdio.h2>main(){ int w=4,x=3,y=2,z=1;printf(”

有以下程序:#includemain(){ int w=4,x=3,y=2,z=1;printf(”%d\n”,(w<x?w:z<y

查看答案

概要设计中要完成的任务是(  )。

概要设计中要完成的任务是(  )。A.系统结构和数据结构的设计 B.系统结构和过程的设计 C.过程和接口的设计 D.数据结构和过程的设计

查看答案

When we listen to a person talkin9,the most important thing

When we listen to a person talkin9,the most important thing for us to do is. A.

查看答案

Her colleagues in publishing thought that being self-employ

Her colleagues in publishing thought that being self-employed would be difficul

查看答案