I am seriously stuck. I'm supposed to write a program that counts by 3's using a for loop with the increment clause either being 1 = i + 3 or i + = 3. So far this is what i have, but it's not even close to working. While it does not tell me that I have errors until the execution, once it runs i get a runtime error and must abort the program. Am I over thinking this? And how do you get the table (\t) function to work with the column headings and contents? This is so confusing! I've reread my book Deitel's C How to Program and looked up as much as I can on the web to find out more information on how to use it, but the book is vague with no examples, and the explanations that I found on the internet were very convoluted .
#include "stdio.h"
void main()
{
int i;
for(i = i + 3; i < 18; i++)
{
if (i % 3 == 0)
printf("\t 'A'","%d", &i);
if (i % 3 != 0)
continue;
printf("\n");
}
for(i = i + 3; i < 20; i++)
{ if (i % 3 == 0)
printf("\t 'A+2", "%d", i);
if (i % 3 != 0)
continue;
printf("\n");
}
}
it should print out a table that looks like this :
Question
Terabojin
I am seriously stuck. I'm supposed to write a program that counts by 3's using a for loop with the increment clause either being 1 = i + 3 or i + = 3. So far this is what i have, but it's not even close to working. While it does not tell me that I have errors until the execution, once it runs i get a runtime error and must abort the program. Am I over thinking this? And how do you get the table (\t) function to work with the column headings and contents? This is so confusing! I've reread my book Deitel's C How to Program and looked up as much as I can on the web to find out more information on how to use it, but the book is vague with no examples, and the explanations that I found on the internet were very convoluted .
it should print out a table that looks like this :
Link to comment
Share on other sites
15 answers to this question
Recommended Posts