面程序执行完后k的值是【 】。
void main()
{
unsigned num=26,k=1;
do
{
K * = num%10;
num/ = 10;
{while(num);
cout<<k;
}
第1题:
运行下列程序时,若输入数据为“321”,则输出结果是( )。 main() {int num,i,j,k,s; scanf("%d",&num); if(num>99) s=3; else if(num>9) s=2; else s=1; i=num/100; j=(num-i*100)/10; k=(num-i*100-j*10); switch(s) {case 3:printf("%d%d%d\n",k,j,i); break; case 2:printf("%d%d\n",k,j); case 1:printf("%d\n",k); } }
A.123
B.1,2,3
C.321
D.3,2,1
第2题:
What will be the output of the following C code?
main()
{
int k, num= 30;
k =(num > 5 ? (num <=10 ? 100:200): 500);
printf("%d", k);
}
第3题:
下面程序的输出结果是【 】。
unsigned fun6(unsigned num)
{ unsigned k=1;
do { k*=hum%10;
num/=10;}while(num);
return(k); }
main()
{ unsigned n=26;
printf("%d\n",fun6(n));}
第4题:
以下程序的输出结果是【 】。
include<iostream.h>
unsigned frn(ullsigned num)
{ unsi9ned k=1;
do{k*=num%10;num/=10;} while(num);
return k;
}
void main()
{ unsigned n=26;
cout<<fun(n) <<endl;
}
第5题:
以下程序的输出结果是unsigned fun6(unsigned num){ unsigned k=1; do{k *=num%10;num/=10;} while (num); return k;}main(){ unsigned n=26; printf("%d\n", fun6(n));}