【单选题】有如下程序 main() { int a=2 b=-1 c=2; if(a) c=2; else if(b<0) c=0; else c++; pr
已帮助 人
【单选题】有如下程序 main() { int a=2,b=-1,c=2; if(a) c=2; else if(b<0) c=0; else c++; printf(“%dn”,c); } 该程序的输出结果是()。
A.3
B.2
C.1
D.0

回答
共1条回复-
B 程序使整型指针p1、p2、p3指向a、b、c值所存放的地址空间。然后再将指针变量*p1、*p2中的值的乘积赋给指针变量*p,即赋给变量c,输出c的值3。
