The value of %11d in the c language is the output, and the mathematical function for finding the absolute value in the c language.doc

1. In C language, the mathematical function to find the absolute value is (A).

A、fabs()

B、exp()

C、pow()

D、sqrt()

2. The C language can use the printf function to achieve output, which is defined in the header file (A).

A、stdio.h

B、lib.h

C、math.h

D、printf.h

3. The following error about variable definition is (A).

A、char for;

B、float USS;

C、double int_;

D、int _int;

4. In C language, the mathematical function for finding the square root is (B).

A、exp()

B、sqrt()

C、pow()

D、fabs()

5. In C language, when using the printf function to output float data, you can use the format control character ( B ).

A、%d

B、%f

C、%c

D、%lf

6. Which of the following statements is correct (B).

A. The loop formed by the do-while statement must use the break statement to exit

B. The loop formed by the do-while statement ends the loop when the loop condition is false

C. The loop formed by the do-while statement ends the loop when the loop condition is true

D. The loop formed by the do-while statement cannot be used

7. After executing the statement for(i=1;i<=10;i++) continue;, the i value is (C).

A、9

B. infinity

C、11

D、10

8. The basic control structure of C language program is (B).

A. Circular structure

B, sequence, branch, loop

C. branch structure

D. Sequential structure

9. float x ; This statement defines the variable x to be of type (B).

A, double precision real

B. Single-precision real type

C. character type

D. Integer

10. The C language can use the getchar() function to implement input, which is defined in the system header file (D).

A、string.h

B. User-defined functions

C、math.h

D、stdio.h

11. Suppose x, y, and z are all integer variables, and the initial values ​​of x and y are 5. After executing z=(++x)+(y--)+1, the three variables of x, y, and z are The values ​​are in order ( D ).

A、6,5,11

B、5,5,11

C、6,4,11

D、6,4,12

12. In C language, the logical expression that three sides a, b, c can form a triangle is (D).

A、a+b>c

B、a>b>c

C、a-bb

D、a+b>c &&a+c>b &&b+c>a

13、下面有关for循环的正确描述是( D )。

A、for循环的循环体不能为空语句

B、for循环是先执行循环体语句,后判定表达式

C、在for循环中,不能用break语句跳出循环体

D、for循环体语句中,可以包含多条语句,但要用花括号括起来

14、使用系统提供的输出函数printf()时,实现换行功能的字符是(D )。

A、'/n'

B、'\b'

C、'\r'

D、'\n'

15、从键盘输入一个整数给变量get,下列正确的语句是( B )。

A、printf("%d",&get);

B、scanf("%d",&get);

C、scanf("%d",get) ;

D、printf("%d",get);

16、变量a、b分别声明为int型和double型,a的初值为5,如果b获得a的一半值,可使用哪条语句( C )。

A、b=a/2;

B、b=sqrt(a);

C、b=a/2.0;

D、b=a-a/2;

17、用来表示“字符变量x为空格或回车”的表达式是( C )。

A、x==' '||x=='\n'

B、x==' '&&x=='\n'

C、x=' '||x='\n'

D、x=' '&&x='\n'

18、能正确判断ch为小写字母的表达式是( C )。

A、ch>'a' && ch

B、ch'z'

C、ch>='a' || ch<='z'

D、ch>='a' && ch<='z'

19、C语言中,执行语句a=(double)5/2;后,a的值是( C )。

A、2.000000

B、5.000000

C、1.000000

D、2.500000

20、在C语言中以下描述错误的是( C )。

A、在switch语句中使用break语句或continue语句的作用相同

B、在循环语句中使用break语句是为了使流程跳出循环体,提前结束循环

C、break语句不能用于循环语句和switch语句外的任何其它语句

D、在循环语句中使用continue语句是为了结束本次循环,而不是终止整个循环

二、判断

1、一个未赋值的普通变量的初始值是随机值。错误

2、可以通过n%10表达式计算一个整数的个位数。错误

3、多分支选择问题只能通过switch 语句实现错误

4、一个C程序可以没有main()函数。错误

5、语句printf("%.2f",1/4+2.75);的运行结果是3。错误

6、表达式3/4+0.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324326074&siteId=291194637