#include "GPrint.h"
#include <limits.h>
int main(void) {
double q = 1000000.0 / 7;
int i = 42;
GPrintf("42 --> base 10:", GP(i),
GP_setbase(2), " 2:", GP(i),
GP_setbase(36), " 36:", GP(i), GP_eol);
GPrintf("million/7 = ", GP(q), GP_eol);
GPrintf("million/7 = ", GP_setprecision(3), GP(q), GP_eol);
GPrintf("million/7 = ", GP_fixed, GP(q), GP_eol);
GPrintf("million/7 = ", GP_fixed, GP_setprecision(3), GP(q), GP_eol);
for (int y = 1; y < 9; y++) {
int x = y * y;
GPrintf(GP_setw(2), GP(y), ",", GP(x), ":", NULL);
GPrintf(GP_repeat(x), GP((char)'*'), GP_eol);
}
GPrintf(GP_setw(5), GP(" "), ":", NULL);
for (int x = 0; x < 70; x += 5)
GPrintf("----+", NULL);
GPrintf(GP_eol);
return 0;
}
`main.c`