《C程序设计语言》读书笔记20091106
书中有几个问题有点模糊。记录一下。
Answer to Exercise 1-7
Write a program to print the value of EOF .
#include <stdio.h>
int main(void)
{
printf("The value of EOF is %d\n\n", EOF);
return 0;
}
EOF在stdio.h中的定义为#define EOF (-1)
其中()被忽略,只使用-1。
相关文档:
源码:
# include <stdio.h>
int main()
{
int x, y, z, mid, dec;
printf("请任意输入三个整数:\n");
scanf("%d %d %d", &x, & ......
源码:
# include <stdio.h>
int main()
{
int num;
/* 下面定义的各变量,分别代表个位,十位,百位,千位,万位,十万位以及位数 */
int indiv, ten, hundred, thousand;
int ten_thousand, hundred_thous ......
源码:
# include <stdlib.h>
# include <stdio.h>
int main()
{
int month;
int day;
printf("please input the month number: ");
scanf("%d", &mo ......
源码:
# include <stdio.h>
int main()
{
int array[16][16];
int i, j, k, m, n;
/* 变量初始化 */
m = 1;
while(m == 1)
{
  ......
源码:
# include <stdio.h>
/* 子函数声明 */
int square(int x); // 实现求平方值的子函数
int cube(int y); // 实现求立方值的子函数
int main()
{
int m = 12;
int n = 4;
printf("%d %d\n", sq ......