作业帮 > 综合 > 作业

1 Determine which of the followings are valid identifiers.

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/11 17:54:07
1 Determine which of the followings are valid identifiers.
(a) 2record
(b) name
(c) name and address
(d) file_3
(e) integer
Answer
a(a),(c)
b(a),(c) and (e)
c(b),(d) and (e)
d(a),(d) and (e)
2
Given the following declaration statements,
int num1,num2;
float firstNum,secNum;
double price,yield;
which is an invalid statement?
Answer
a scanf("%d %f %lf",&num1,&price,&yield);
b scanf("%f %d %lf",&firstNum,&num2,&yield);
c scanf("%d %f %lf",&num1,&secNum,&price);
d scanf("%d %d",&num1,&num2);
3
Write a declaration statement for the variable used in the following input statement:
scanf("%f",&aveMark);
Answer
a double aveMark;
b long aveMark;
c float aveMark;
d int aveMark;
4
Which is the declaration statement for the variable used in the following input statement?
scanf("%d",&day);
Answer
a double day;
b char day;
c float day;
d int day;
5
Suggest the right data type and variable name to represent the population of the world (7 billion).
Answer
a char worldPop;
b int popWorld;
c float pop_world;
d float pop-world;
6
Which of the following statements is/are valid for the variables used in the following statement:
scanf("%f %f %d",&firstNum,&secondNum,&count);
Answer
a double firstNum,secondNum;
int count;
b int firstNum,secondNum,count;
c float firstNum,secondNum;
int count;
d float firstNum,secondNum,count;
/>a
c
d
cd
cd