[ create a new paste ] login | about

Link: http://codepad.org/twiOoHeS    [ raw code | output | fork ]

C, pasted on Nov 16:
#include <stdio.h>

void count()
{
	static int c = 0;
	
	++c;
	
	printf("%d", c);
	if (c % 3 == 0) {
		putchar('!');
	}
	if (c % 5 == 0) {
		putchar('?');
	}
	putchar(' ');
}

int main(void) 
{ 
	int i; 
	
	for (i = 0; i < 20; i++) {
		count(); 
	}
	
	return 0; 
} 


Output:
1
1 2 3! 4 5? 6! 7 8 9! 10? 11 12! 13 14 15!? 16 17 18! 19 20? 


Create a new paste based on this one


Comments: