/* this file level comment block contains the file header:
name, class, section, assignment no. etc.
*/
#include <stdio.h>
/* this comment could describe the global variables and their purpose */
extern int globalDefinedElsewhere;
int globalDeclaredHere;
float globalDefinedHere = 20.5;
/* this comment could describe any function declarations */
int functionDeclaredHere(int param);
/* this comment could describe the following function, its parameters
and its purpose */
void functionDefinedHere(int x) {
while (x > 10) {
int localVariable = x * 10; /* this comment is for this statement only */
printf("Value of x is %d\n", x);
}
}
/* the main function follows */
int main() {
...
}