- 阅读权限
- 255
- 威望
- 0 级
- 论坛币
- 4870 个
- 通用积分
- 0
- 学术水平
- 5 点
- 热心指数
- 5 点
- 信用等级
- 5 点
- 经验
- 1110 点
- 帖子
- 371
- 精华
- 0
- 在线时间
- 354 小时
- 注册时间
- 2005-7-31
- 最后登录
- 2021-12-13
|
- EXERCISES 1
- 1. What makes it possible to do such a variety of things on a computer?
- 2. Computers can execute instructions written in what language?
- 3. Give two advantages of assembly language over machine language.
- 4. Give two advantages of a high-level language over assembly language.
- 5. Describe two main tasks performed by a compiler.
- 6. Describe the steps required to solve a problem on a computer.
- 7. Distinguish between an algorithm and a program.
- 8. Programming instructions fall into 3 main categories; what are they?
- 9. Distinguish between a syntax error and a logic error.
- 10. What is meant by “debugging a program”?
- 11. Name 5 data types commonly used in programming and give examples of constants
- of each type.
- 12. What are the different classes into which characters can be divided? Give examples
- in each class.
- 13. What is the purpose of comments in a program?
- 14. Write a program to print Welcome to C on the screen.
- 15. Write a program to print the following:
- There is a tide in the affairs of men
- Which, taken at the flood, leads on to fortune
- 16. Write a program to print any 4 lines of your favourite song or poem.
- 17. Same as exercise 16, but print a blank line after each line.
- 18. If a is 29 and b is 5, what is printed by each of the following statements?
- printf(“The product of %d and %d is %d\n”, a, b, a * b);
- printf(“%d + %d = %d\n”, a, b, a + b);
- printf(“%d - %d = %d\n”, a, b, a - b);
- printf(“%d x %d = %d\n”, a, b, a * b);
- 19. If a is 29 and b is 14, what is printed by the following statements?
- printf(“%d + \n”, a);
- printf(“%d\n”, b);
- printf(“—\n”);
- printf(“%d\n”, a + b);
- 20. If rate = 15, what is printed by
- (a) printf(“rate\n”)?
- (b) printf(“%d\n”, rate)?
复制代码
|
-
总评分: 论坛币 + 20
查看全部评分
|