网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

有以下程序 #include 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(“%d\n”,p);


参考答案

更多 “ 有以下程序 #include 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(“%d\n”,p); ” 相关考题
考题 有以下程序#include stdio.hmain( ){ 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("%d\n",p);

考题 有以下程序 include main() { int n,*p=NULL; *p=n; printf(" 有以下程序 #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("%d\n",p);

考题 有以下程序:inlucdemain()D)2 3 3{int n,*P=NULL;*p=printf("input n:");scanf("%d 有以下程序: #inlucde<stdio.h> main()D)2 3 3 {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("%d\n",p);

考题 有以下程序#include stdio.hmain { 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("%d\n",p);

考题 有以下程序: #include stdio.h main( ) { struct node{int n; struct node*next;} *P; struct node x[3]={{2,x+1),{4,x+2},{6,NULL}}; P= X; printf("%d,",p-n); printf("%d\n",p-next-n); } 程序运行后的输出结果是( )。A.2,3B.2,4C.3,4D.4, 6

考题 有以下程序includemain(){ char*p,*q;p=(char *)malloc(sizeof(char)*20);q=p;scanf( 有以下程序 #include<stdlib.h> main() { char*p,*q; p=(char *)malloc(sizeof(char)*20);q=p; scanf(“%s%s”,p,q);printf(“%s%s\n”,p,q); } 若从键盘输入:abc def<回车>,则输出结果是A.def defB.abc defC.abc dD.d d

考题 有以下程序include main(){ char *p,*q;p=(char*)malloc(sizeof(char)*20);q=p;scanf 有以下程序 #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20); q=p; scanf("%s %s",p,q); printf("%s %s\n",p,q); } 若从键盘输入:abc def<回车>, 则输出结果是A.def defB.abc delC.abc dD.d d

考题 有以下程序: include main( ) { char *p ,* q; p=(char * )malloc(sizeof(char 有以下程序: #include<stdlib.h> main( ) { char *p ,* q; p=(char * )malloc(sizeof(char) * 20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是A.def defB.abc defC.abc dD.d d

考题 若输入“abcdef”“abdef”,下述程序的输出结果为( )。#include#includemain{int n;char s1[20],s2[20],*p1,*p2;scanf(%s,s1);scanf(%S,s2);p1=s1;p2=s2;n=strcmp(p1,p2);printf(Vood\n,n); }A.-1B.0C.abcdefD.abdef