summaryrefslogtreecommitdiff
path: root/reference/C/CONTRIB/OR_PRACTICAL_C/09_5.c
diff options
context:
space:
mode:
Diffstat (limited to 'reference/C/CONTRIB/OR_PRACTICAL_C/09_5.c')
-rw-r--r--reference/C/CONTRIB/OR_PRACTICAL_C/09_5.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/reference/C/CONTRIB/OR_PRACTICAL_C/09_5.c b/reference/C/CONTRIB/OR_PRACTICAL_C/09_5.c
new file mode 100644
index 0000000..6428f43
--- /dev/null
+++ b/reference/C/CONTRIB/OR_PRACTICAL_C/09_5.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#define SQR(x) ((x) * (x))
+
+main()
+{
+ int counter; /* counter for loop */
+
+ counter = 0;
+ while (counter < 5)
+ (void)printf("x %d square %d\n",
+ counter, SQR(counter++));
+ return (0);
+}