Here is the program I wrote:
int main(void)
{
int d1, d2;
d1 = 48;
while (d1 < 58)
{
d2 = d1 + 1;
while (d2 < 58)
{
putchar(d1);
putchar(d2);
putchar(',');
putchar(' ');
d2++;
}
d1++;
}
putchar(10);
return (0);
}
Output of the program is as follows:
01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89, $
I want the output like this:
01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89$
How can I get the comma to stop before last digit?