有以下程序: void main(){ int a, b = 12345; float c = 123.444; double d = 1234.56789; a=c; printf("%2d, %-2d, %-2.1f, %2.1f\n", a, b, c, d); }执行后输出结果是()
A. 123, -12345, 123.4, 1234.5
B. 12, -12, -123.4, 1234.6
C. 123, 12345, 123.4, 1234.6
D. 45, -23, -23.4, 34.6
下列选项中,可实现“显示浮点型变量grade的值,保留小数点后2位”的是()
A. scanf("%f", grade);
B. scanf("%.2f", &grade);
C. printf("%2.f", grade);
D. printf("%.2f", grade);