A-A+

有以下程序: #inlucde<stdio.h> main()D)2 3 3 {int n

2022-08-06 06:45:04 问答库 阅读 177 次

问题详情

有以下程序: #inlucde<stdio.h> main()D)2 3 3 {int n,*P=NULL; *p=&n; printf("input n:");scanf("%d",&p);printf("output n:");printf("%dn",p); } 该程序试图通过指针P为变量n读入数据并输出,但程序有多处错误,以下语句正确的是()。
A.int n,*P=NULL;
B.*P=&n;
C.scanf(“%d",&p)
D.printf("%dn",p);请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:A

考点:程序