下列程序的执行结果为( )。float f1(float x){ int k=2;k=k*x;return k; }voidmain(){ float b=4.3;printf("%.1f",f1(b));}
A: 8.6
B: 9.0
C: 8.0
D: 8
A: 8.6
B: 9.0
C: 8.0
D: 8
举一反三
- 智慧职教: 下列程序的执行结果为 float f1(float x) { float k=2; k=k*x; return k; } void main() { float b=4.3; printf("%.1f",f1(b)); }
- 下列程序段的输出是_____ , 。# include <stdio.h>int f(int x){ static y=1; y++; x += y; return x;}void main(){ int k; k=f(3); printf("%d,%d\n", k, f(k));}
- float f(float x,int n){if(n==0) return 1;else return x*f(x , n-1);}main(){intn=5; float x=2.0;printf(〝%f〞,f(x,n)); } A: 16.00000 B: 8.00000 C: 32.00000 D: 64.00000
- 下列程序执行后的输出结果是(小数点后只写1位)( )。#include "stdio.h"main( ){double d;float f;long k;int i;i=f=k=d=20.0/3;printf("%d %ld %.1f %.1f ", i,k,f,d);}
- 已知f1(k)=ε(k)-ε(k-3), f2(k)=2[ε(k+1)-ε(k-2)], 若f(k)=f1(k)*f2(k), 则f(1)的值为