[单选题]

有以下程序

#include <stdio.h>

main()

{ int m=1,n=2,*p=&m,*q=&n,*r;

r=p;p=q;q=r;

printf("%d,%d,%d,%d/n",m,n,*p,*q);

}

程序运行后的输出结果是

A.)1,2,1,2

B.)1,2,2,1

C.)2,1,2,1

D.)2,1,1,2

参考答案与解析:

相关试题

有以下程序:include<stdio.h>main( ){int m=1,n=

[单选题]有以下程序:include<stdio.h>main( ){int m=1,n=2,*p=&m,*q=&n,*r;r=P;P=q;q=r;printf("%d,%d,%d,%d/n",m,n,*P,*q);}程序运行后的输出结果是( )。A.1,2,1,2B.1,2,2,1C.2,1,2,1D.2,1,1,2

  • 查看答案
  • 有以下程序 #include<stdio.h>main(){int m=1,n=

    [单选题]有以下程序#include<stdio.h>main( ){ int m=1,n=2,*P=&m,*q=&n,*r;r=P;P=q;q=r;prinff(“%d,%d,%d,%d\n”,m,n,*P,*q);}程序运行后的输出结果是A.1,2,1,2B.1,2,2,lC.2,1,2,1D.2,1,1,2

  • 查看答案
  • 有以下程序#include <stdio.h>main( ){ int n,*p

    [单选题]有以下程序#include <stdio.h>main( ){ int n,*p=NULL;*p=&n;printf("Input n:"); scanf("%d",&p); printf("output n:"); printf("%d/n",p);}该程序试图通过指针 p 为变量 n 读入数据并输出,但程序有多处错误,以下语句正确的是A.)int n,*p=NULL;B.)*p=&n;C.)scanf("%d",&p)D.)pr

  • 查看答案
  • 有以下程序#include <stdio.h>main{ int n,*p=NU

    [单选题]有以下程序#include <stdio.h>main { int n,*p=NULL; *p=&n; printf("Input n:"); scanf("%d",&p); printf("output n:"); printf("%d/n",p);}该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是A.int n,*p=NULL; B.*p=&n; C.scanf("%d",&p) D.printf(

  • 查看答案
  • 有以下程序#include <stdio.h>main( ){ int a[ ]

    [单选题]有以下程序#include <stdio.h>main( ){ int a[ ]={1,2,3,4},y,*p=&a[3];--p; y=*p; printf("y=%d/n",y);}程序的运行结果是A.)y=0B.)y=1C.)y=2D.)y=3

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ int a[ ]=

    [单选题]有以下程序#include <stdio.h>main(){ int a[ ]={2,3,5,4},i;for(i=0;i<4;i++)switch(i%2){ case 0:switch(a[i]%2){case 0:a[i]++;break;case 1:a[i]--;}break;case 1:a[i ] =0;}for(i=0;i<4;i++) printf("%d",a[i]); printf("/n");}程序运行后的输出结果是A.)3 3 4 4B.

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ int a=1,b

    [单选题]有以下程序#include <stdio.h>main(){ int a=1,b=2,c=3,x;x=(a^b)&c; printf("%d/n",x);}程序的运行结果是A.)0B.)1C.)2D.)3

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ int a=1,b

    [单选题]有以下程序#include <stdio.h>main(){ int a=1,b=2,c=3,d=0;if (a==1 && b++==2)if (b!=2||c--!=3)printf("%d,%d,%d/n",a,b,c);else printf("%d,%d,%d/n",a,b,c);else printf("%d,%d,%d/n",a,b,c);}程序运行后输出结果是A.)1,2,3B.)1,3,2C.)1,3,3D.)3,2,1

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ int a=1,b

    [单选题]有以下程序#include <stdio.h>main(){ int a=1,b=0;printf("%d,",b=a+b);printf("%d/n",a=2*b);}程序运行后的输出结果是A.)0,0B.)1,0C.)3,2D.)1,2

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ int x=1,

    [单选题]有以下程序#include <stdio.h>main() { int x=1, y=2, z=3; if(x>y) if(y<z) printf("%d", ++z); else printf("%d", ++y); printf("%d/n", x++);}程序的运行结果是A.331 B.41 C.2 D.1

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ int m=1,n