以下关于switch语句和break语句的描述中,只有()是正确的。
A.在switch语句中必须使用break语句
B.在switch语句中,可以根据需要使用或不使用break语句
C. break 语句只能用于switch语句中
D. break 语句是switch语句的部分
下列程序编译运行后的输出为( )。#include int main() {int i,j,m,n;i=8; j=10; m=++i; n=j++;printf("%d,%d,%d,%d\n",i,j,m,n); return 0; }
A. 8,10,9,10
B. 9,11,9,10
C. 9,10,9,9
D. 8,10,9,9
【单选题】下面程序执行后的输出结果是( )。#include int f( int b[], int m, int n ){ int i, s = 0; for ( i = m; i < n; i++ ) s = s + b[i - 1]; return(s);}int main(){ int x, a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; x = f( a, 3, 7 ); printf( "%d", x ); return(0);}。
A. 10
B. 18
C. 8
D. 15