A13 Answer
#include <stdio.h>
#include <stdlib.h>
/* Puzzle A13 -- print integers from 1 to n that are not
| multiples of 3 or 5.
| Print 10 integers per line.
| End the last line with "\n", even if the line has fewer than
| ten numbers on it.
|
*/
int main(int argc, char *argv[])
{
int j;
int count = 0;
int n = 100;
for (j=1; j<=n; j++ )
{
if ( !(j%3 == 0 || j%5 == 0 ) )
{
printf("%3d", j);
if ( count%10==9 ) printf("\n");
count++ ;
}
}
if ( count%10 != 9 ) printf("\n");
system("PAUSE");
return 0;
}