C程序设计(第版)(谭浩强)完整版_课后习题答案.docVIP

  • 55
  • 0
  • 约 83页
  • 2016-10-15 发布于广东
  • 举报

C程序设计(第版)(谭浩强)完整版_课后习题答案.doc

C程序设计(第版)(谭浩强)完整版_课后习题答案

C程序设计(第四版)(谭浩强)第一章课后习题答案 P006 1.1 向屏幕输出文字. #include stdio.h //预编译. 代码均调试成功,若有失误大多不是代码问题.自已找找. int main() { printf(Welcome to \n); return 0; //与int main对应,为了程序可移植性,建议全用int main + return 0;. } P008 1.2 求两个数的和. #include stdio.h int main() { int a,b,sum; a=5; b=4; sum=a+b; printf(The sum is %d .\n,sum); return 0; } P008 1.3 调用函数比较两个数的大小. #include stdio.h int main() { int max(int x,int y); //被调用函数在主函数后面,用前先声明. int a,b,c; scanf(%d,%d,a,b); //输入时要按格式来,此处的逗号,用空格会发生错误. c=max(a,b); //a,b作为实参传入被调用函数中. printf(The max is %d .\n,c); return 0;

文档评论(0)

1亿VIP精品文档

相关文档