C语言一问

来源:百度知道 编辑:UC知道 时间:2024/06/08 07:12:17
The c statment that would store three integers keyed in by the user in the type int variable n1,n2,and n3 is?

1. The constant 0.15e+6 represents the same value as __________.
a. 150000.0
b. 6.15
c. 0.75
d. 0.21
e. none of the above
此题选a,因为0.15e+6表示0.15×10的6次方

2. What would be displayed by the following program? (The symbol '#' stands for one blank character.)
int
main(void)
{
double a, b;
a = 37.56;
b = 101.117;

printf("Is it%6.1f%9.4f", a, b);

printf("?\n");
return (0);
}

a. Is#it##37.6#101.1170?\n
b. Is#it##37.6#101.1170?
c. Is#it##37.5#101.1170?
d. Is#it##37.6#101.117?\n
e. none of the above

此题应该选择b,\n表示换行符,此字符不是可见字符,所以排除了a和d;还因为在格式化字符串时会采取4舍5入法,所以选择b

3. If num is a variable of type int and temp is a variable of type double, how could you correctly complete this function call?
scanf("%lf%d", _________);

a. num, temp
b. &num, &temp