J
Jonathan Pritchard
I know this is a simple problem, but I've just included this in the
title because it explains what my program tries to do.
The following does not work, it for someone reason does not want to
place the values on a new line.
=======================================================================
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* Variable delcaration */
long i=1, counter=1, tally=0;
/* Program Body */
do {i = i * 2;
printf("%d \t %d \n", counter, i); /* <======= Here */
++counter;
}
while (counter != 65);
getch();
}
=======================================================================
Whereas the following does work, but all the numbers are in a long line
and not separated. The following does work:
=======================================================================
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* Variable delcaration */
long i=1, counter=1, tally=0;
/* Program Body */
do {i = i * 2;
printf("%d", i); /* <======= Here */
++counter;
}
while (counter != 65);
getch();
}
=======================================================================
I'd really like to know why. Out of curiosity, I don't seem to be doing
anything wrong, to my knowledge. Thanks.
title because it explains what my program tries to do.
The following does not work, it for someone reason does not want to
place the values on a new line.
=======================================================================
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* Variable delcaration */
long i=1, counter=1, tally=0;
/* Program Body */
do {i = i * 2;
printf("%d \t %d \n", counter, i); /* <======= Here */
++counter;
}
while (counter != 65);
getch();
}
=======================================================================
Whereas the following does work, but all the numbers are in a long line
and not separated. The following does work:
=======================================================================
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* Variable delcaration */
long i=1, counter=1, tally=0;
/* Program Body */
do {i = i * 2;
printf("%d", i); /* <======= Here */
++counter;
}
while (counter != 65);
getch();
}
=======================================================================
I'd really like to know why. Out of curiosity, I don't seem to be doing
anything wrong, to my knowledge. Thanks.