复习资料
第一章 C语言基础
1)int, char, float, double are all basic data types in C language. (对)
2)Provided that the length of int is 16 bits, then the value scope of unsigned int is:(B)
A.0~255 B.0~65535 C.-32768~32767 D.-256~255
3)The declaration is:
int k=0,a=0,b=0;
unsigned long w=5;
double x=1.42,y=0;
then the incorrect expression is_A__
A.y=x%3 B. w+= -2 C. x=w+5 D. k*=a+b 5) Given declaration: char c= \035 ; the size of c i混合数据类型的运算
1)Suppose declaration: char a= c ; then statement: printf(“%d”,a); is wrong.(错)
2)Suppose declaration:
int a;
float x,y;
then the result data type of expression: 3)The data type of expression: 18/4*sqrt(4.0) is float. (错)
字符的ASCII值及其合理应用
1)Suppose declaration: char a; then expression: ch= 5+9 is correct.(错)
2) ASCII of A is 65.then read the following programand the result of it.
Fill the blanks:
main()
{
char a;
a= A +__ printf(“%c”,a);
}
result: L
3) To get a character with getchar(), you can input corresponding ASCII number of the desired character from keybord.(错)
1) Suppose declaration:
int a;
float f;
double i;
then the result data type of expression:
10+ a +i*f is _1. 常量
字符常量的定义形式:
#define PRICE 30