#include main(){ int a[10]={1,2,3,-4,5,6,7,-8,9,10},s=0;for(int i=0;i<10;i++) if (a[i]<0) s+=a[i]; printf("%d",s);}The result of this program excuted is ______
查看答案
What is the result of this program excuted? ______ #include main(){ int i=3; switch ( i ) { case 1: i*=1; case 2: i*=2; case 3: i*=3; default : i*=4; } printf("i=%d\n",i);}
How many times is the loop body " k++;" executed in the following program segment? ( ) int k=0; while(k=1) k++;
A. Infinite
B. 1
C. 0
D. compile error
According to the declaration " struct stu{ int age; int num;} s, *p=&s;", which one is incorrect reference to the member "age" of variable "s"? ( )
A. s.age
B. stu.age
C. p->age
D. (*p).age
Which one is equivalent to the expression "!x" in " while(!x)"? ( )
A. x==0
B. x==1
C. x!=1
D. x!=0