下列程序运行后的输出结果为。
# include
int num;
void fun
{
printf ( "%d, ", num );
}
int main
{
int num = 3;
fun ;
printf ( "%d,", num );
return 0;
}
# include
int num;
void fun
{
printf ( "%d, ", num );
}
int main
{
int num = 3;
fun ;
printf ( "%d,", num );
return 0;
}
0, 3,
举一反三
- 分析下列程序,写出运行结果。#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=10;int func(){int num=4;return ++num;}int main(){printf("%d\n",func());return 0;} A: 1 B: 4 C: 5 D: 10
- 以下程序的输出结果是#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));}
- 以下程序输出结果为:#include<;stdio.h>;int num(int x,int y){int a,b;a=x+y;b=x-y;}int main(){int a=3,b=2;int x,y;x=a+b;y=a-b;num(a,b);printf("%d",a);return 0;}
- 以下程序段的输出结果是 。 int main(void) { int num = 0,s = 0; while(num <= 2){ num++; s += num; } printf("%d\n",s); return 0; }
内容
- 0
下列程序的运行结果是()。#include [stdio.h] void func(int n) { static int num=1; num=num+n; printf(" %d",num); } int main() { func(3); func(4); printf("\n"); return 0; } A: 4 8 B: 3 4 C: 3 5 D: 4 5
- 1
程序运行后的输出结果是( ) main() { int a[3]={1,2,3}; int*num[3]; int **p,i; for(i=0;i<3;i++) num[i]=&a[i]; p=num; printf("%d",**p); }
- 2
#include <;stdio.h>;int fun(int x);int main(){ printf("%d",fun(4)); return 0;}int fun(int x){ if(x==1)return 3; return x*x+fun(x-1);}程序输出结果为( )
- 3
下列程序的运行结果是( ) #include void fun(); int a=5; int main() { int a=10; fun(); printf("%5d",a); return 0; } void fun() { a=a+5; printf("%5d",a); }
- 4
main(){int num=0;while(num<;=2){num++;printf("%d\n",num);}}