以下程序的输出结果是#include<;stdio.h>;int fun6(int num){ int k=1;do{ k*=num%10; num/=10;}while(num);return k;}main( ){ int n=26;printf(“%d\n”,fun6(n));}
举一反三
- 分析下列程序,写出运行结果。#includeint fun( int num ){ int k=1; while(num){ k=k* (num%10); num=num/10; } return k;}int main(){ int x=255; printf("x=%d\n",fun(x));}程序的运行结果是:______
- 下列程序运行后的输出结果为。 # include <stdio.h> int num; void fun { printf ( "%d, ", num ); } int main { int num = 3; fun ; printf ( "%d,", num ); return 0; }
- 下面程序的输出结果是( )。#include <;stdio.h>;int num=10;int func(){int num=4;return ++num;}int main(){printf("%d\n",func());return 0;} A: 1 B: 4 C: 5 D: 10
- 以下程序段的输出结果是( )。int main(){int num=0,s=0;while(num<=2) { num++; s+=num; } printf("%d\n",s);}A)10 B)6 C)3 D)1 A: 1 B: 3 C: 10 D: 6
- Function fun(ByVal num As Long) As Long Dim k As Long k = 1 num = Abs(num) Do While num k = k * (num Mod 10) num = num \ 10 Loop fun = k End Function Private Sub command1_click() Dim n As Long, r As Long n = Val(InputBox("请输入一个数:")) r = fun(n) Print r End Sub 程序运行后,单击命令按钮,输入1234,输出结果为:( )