C examples for Language Basics:printf
The following program produces a table of squares and cubes for the numbers between 1 and 19:
#include <stdio.h> int main(void) { int i;/*from www.j av a 2 s . com*/ /* display a table of squares and cubes */ for (i = 1; i<20; i++) printf("%8d %8d %8d\n", i, i*i, i*i*i); return 0; }