若变量m已定义,以下程序段中的do-while循环次数是________ m=-1; do{ m=m*m;}while(!m);
若变量m已定义,以下程序段中的do-while循环次数是________ m=-1; do{ m=m*m;}while(!m);
参考答案和解析
1 或者 一
相关考题:
单击命令按钮时,下列程序的运行结果为 Private Sub Command1_Click() Print Fun(23,18) End Sub Public Function Fun(m As Integer,n As Integer)As Integer Do While m<>n Do While m>n:m=m-n:Loop Do While m<n:n=n-m:Loop Loop Fun=m End FunctionA.0B.1C.3D.5
(25)下列程序的运行结果是 。 Private Function myfun(m,n) Do While mn Do While mn:m=m-n:Loop Do While nm:n=n-m:Loop Loop myfun=m End Function Private Sub Command1_Click() Print myfun(9,8) End SubA.2 B.1 C.4 D.3
下列程序是死循环的是A.for(;;);B.int s=36; while(S)--S;C.int m=10; do { m- - }while(m0);D.int n=5; while(n1) { n- -; if(n0)break; }
有以下程序 main() { int m,n; printf("Enter m,n:");scanf("%d%d",m,n); while(m!=n) { while(m>n)m-=n; while(n>m)n-=m; } printf("m=%d\n",m); } 如果从键盘上输入65 14<回车>,则输出结果为( )A.m=3B.m=2C.m=1D.m=0
下列程序的运行结果是( )。 Private Function myfun(m,n) Do while mn Do While mn:m=m-n:Loop Do Wllile nm:n=n-m:Loop Loop myfun=m End Function Private Sub Command1_Click( ) print myfun(9,8) End SubA.2B.1C.4D.3
运行以下程序后,如果从键盘上输入6514,则输出结果为______。 main() { int m,n; printf("En 运行以下程序后,如果从键盘上输入6514<回车>,则输出结果为______。 main() { int m,n; printf("Enter m,n:"); scanf("%d%d",m,n); while(m!=n) { while(m>n)m-=n; while(n>m)n-=m; } printf("m=%d\n",m); }A.m=3B.m=2C.m=1D.m=0
下列程序是死循环的是 ( )A.for(;;)B.int s=36; while(s)=s;C.int m=10; do{m- -;}while(m>0);D.int n=5; while(n>1) { n- -; if(n<0)break; }
单击命令按钮时,下列程序代码的运行结果为 Private Sub Command1_Click() Print MyFunc(20, 18) End Sub Public Function MyFunc(m As Integer, n As Integer)As Integer Do While m<>n Do While m>n:m=m-n:Loop Do Whle m<n:n=n-m:Loop Loop MyFunc=m End FunctionA.0B.2C.4D.6
单击命令按钮时,下列程序的运行结果为Private Sub Command1_Click( ) Print MyBM(23,18)End SubPublic Function MyBM(m As Integer,n As Integer)As Integer Do While m n Do While m > n:m=m - n:Loop Do While m < n:n=n - m:Loop Loop MyBM=mEnd FunctionA.0B.1C.3D.5
单击命令按钮时,下列程序代码的运行结果为 Private Sub Command1_Click() print MyFunc(20,18) End Sub Public Function MyFunc (m As Integer,n As Integer)As Integer Do While m n Do While m > n:m=m - n:Loop Do While m < n:n=n - m:Loop Loop MyFunc=m End FunCtionA.0B.2C.4D.6
下面程序的运行结果是 ______ 。程序的功能是 _______ 。Public Function myfun(m,n)Do while m>nDo while m>n:m=m-n:LoopDo While n>m:n=n-m:LoopLoopMyfun=mEnd FunctionPrivate Sub Command1_Click()Print myfun(15,15)End Sub
单击命令按钮时,下列程序的运行结果为 Private Sub Command1_Click( ) Print Fun(23, 18) End Sub Public Function Fun(m As Integer, n As Integer) As Integer Do Whilem <> n Do While m > n : m--m - n: Loop Do While m < n : n=n - m: Loop Loop Fun =m End FunctionA.0B.1C.3D.5
单击命令按钮时,下列程序代码的执行结果为______ 。Public Function MyFune(m As Integer,n As Integer) As Integer Do While m<>n Do While m>n m=m-n Loop Do While m<n n=n -m Loop Loop MyFunc=mEnd FunctionPrivate Sub Command1_Click() Print MyFunc(24, 18)End SubA. 2B.4C.6D.8
下列程序的运行结果是( )。 Private Function myfun(m,n) Do While m>n Do While m>n:m=m-n:Loop Do While n>m:n=n-m:Loop Loop myfun=m End Function Private Sub Command1_Click() Print myfun(9,8) End SubA.2B.1C.4D.3
下列程序的运行结果是( )。 Private Function myfun(m, n) Do While m > n Do While m>n:m=m-n:Loop Do while n>m:n=n-m:Loop Loop myfun=m End Function Private Sub Command1_Click() Print myfun(9, 8) End SubA.2B.1C.4D.3
下列各程序段中,不是死循环的是( )。A.int j=100;B.for(;;) while(1) {j=j%100+1; if(j>1000) break; }C.int n=0;D.int m=36; do{ while(m)--m; ++n; }while(n>=0);
假定w、x,y、z、m均为int型变量,有如下程序段; w=1;x=2;y=3;z=4; m=(w<x)?w:x; m=(m<y)?m:y; m=(m<z)?m:z; 则该程序段执行后,m的值是( )A.4B.3C.2D.1
在下列程序中,如果要使程序继续循环,变量M的输入值应为()。DO WHILE .T.WAIT "M="TO MIF UPPER(M)$"YN" EXIT ENDIFENDDOA、YB、YC、ND、C