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

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

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

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

return 0;

}

When compiled using GCC and then executed, this program produced the following output:

Value of i: 5618848

Value of j: 0

Value of k: 6844404

Value of x: 3.98979e-34

Value of y: 9.59105e-39

Value of z: 9.59105e-39

The values printed depend on many factors, so the chance that you'll get exactly these numbers is small.

5. [was #10] (a) is not legal because 100_bottles begins with a digit.

8. [was #12] There are 14 tokens: a, =, (, 3, *, q, -, p, *, p, ), /, 3, and ;.

Answers to Selected Programming Projects

4. [was #8; modified]

#include <stdio.h>

int main(void)

{

float original_amount, amount_with_tax;

printf("Enter an amount: ");

scanf("%f", &original_amount);

amount_with_tax = original_amount * 1.05f;

printf("With tax added: $%.2f\n", amount_with_tax);

return 0;

}

The amount_with_tax variable is unnecessary. If we remove it, the program is slightly shorter:

#include <stdio.h>

上一页第2页

你可能喜欢

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

热门文档

相关文档

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