文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 高等教育 > 工学 > C语言程序设计现代方法(第二版)习题答案
侵权投诉

C语言程序设计现代方法(第二版)习题答案

[美]K.N.King 著 吕秀锋 黄倩 译

Chapter 2

Answers to Selected Exercises

2. [was #2] (a) The program contains one directive (#include) and four statements (three calls of printf and one return).

(b)

Parkinson's Law:

Work expands so as to fill the time

available for its completion.

3. [was #4]

#include <stdio.h>

int main(void)

{

int height = 8, length = 12, width = 10, volume;

volume = height * length * width;

printf("Dimensions: %dx%dx%d\n", length, width, height);

printf("Volume (cubic inches): %d\n", volume);

printf("Dimensional weight (pounds): %d\n", (volume + 165) / 166);

return 0;

}

4. [was #6] Here's one possible program:

#include <stdio.h>

int main(void)

{

int i, j, k;

float x, y, z;

printf("Value of i: %d\n", i);

printf("Value of j: %d\n", j);

printf("Value of k: %d\n", k);

printf("Value of x: %g\n", x);

printf("Value of y: %g\n", y);

第1页

你可能喜欢

  • c语言程序设计答案
  • c语言程序设计习题答案
  • 新视野大学英语视听说答案
  • 语言分析
  • Linux内核
  • 同济大学第六版高等数学答案
  • C语言程序第二版设计答案

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email