alignment problem
Can correct my code below for the alignment problem
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include <stdafx.h>
#include <stdio.h>
int main()
{
int i,j,mul;
printf("\t1\t2\t3\t4\t5\t6\t7\t8\n\n");
for( i=1; i<9; i++)
{
printf("%d\n",i);
for( j=1; j<9; j++)
{
mul = i * j;
printf("%d\t",mul);
}
}
return 0;
}
| |
but i wish the output will be like this.
1 2 3 4 5 6 7 8
1 1 2 3 4 5 6 7 8
2 2 4 6 8 10 12 14 16
3 3 6 9 12 15 18 21 24
4 4 8 12 16 20 24 28 32
5 5 10 15 20 25 30 35 40
6 6 12 18 24 30 36 42 48
7 7 14 21 28 35 42 49 56
8 8 16 24 32 40 48 56 64
Press any key to continue . . . |
Please correct for me.
Topic archived. No new replies allowed.