






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







This prints a table with two columns, the left being Fahrenheit degrees, and the right the corrsponding Celsius tem- peratures.
#include <stdio.h>
/*
/*
/*
This does the same thing using different control structures and floating point arithmetic.
#include <stdio.h>
#define LOWER 0 /* begin table here / #define UPPER 300 / end table here / #define STEP 20 / increment */
/*
/*
/*
This does the same thing, but uses different control structures. Most C programmers would write this program the previous way.
#include <stdio.h>
/*
/*
/*
This program counts the number of lines, words, and characters in its input, where a “word” is defined as any sequence of non-whitespace characters (blanks, tabs, and newlines).
#include <stdio.h>
#define IN_WORD 1 /* currently inside a word / #define NOTIN_WORD 0 / currently not in a word */
/*
/*
/*
/*
This is similar to the word counting program, but counts digits, whitespace, and everything else (grouped into the cat- egory “other”). Note the array.
#include <stdio.h>
/*
/*
/*
/*
putchar('\n'); printf("whitespace: %d\nother: %d\n", nwhite, nother); exit(0); }
putchar('\n'); printf("whitespace: %d\nother: %d\n", nwhite, nother); exit(0); }
This program prints a table of 2 and -3 raised to the powers 0 to 9 inclusive. It illustrates the use of function calls.
#include <stdio.h>
/*
/*
/*
/*