Hey guys im trying to print this
Code:
0 5 10 15 20 25 30 35
+----+----+----+----+----+----+----+-
|
|
|
|
5 |
|
|
10
15
20
25
and so on with 5 hiphens | in between each number i cant get the formatting correctly?
30
35
could someone take a look
thankyou
Code:
/* print the numbers*/
for(pos=0; pos<8; pos++)
{
n = pos * 5;
printf(" %-3d", n);
}
/* after a new line space print
each +----+ once at a time in the loop*/
/*
for(b=0; b<VER_ARRAY; b++)
{
}*/
printf("\n");
printf(" +----+----+----+----+----+----+----+-");
printf("\n");
/*for the amount entered keep printing numbers
on vertical axis limited to user input*/
/*keep printing hiphens for each interval*/
for(a =0; a<5; a++)
{
printf(" |");
printf("\n");
}
for(d=1; d<4; d++)
{
n = 0;
n = d * 5;
printf("%-5d\n", n);
/*
for(e =0; e<5; e++)
{
printf(" |");
printf("\n");
}*/
}
/* for the size of num being entered if
0 integers have been entered make it valid*/
for(c=0; c<sizeof(num[c]); c++);
{
if(num[c] %5 ==0)
{
printf("\n");
}
}
printf("\n");