>Now you could write n assignment statements one below the other
Presumably the requirement is that n is an unknown quantity until runtime, in which case hard coding the statements is not possible in a compiled language. You could write a second program that builds the hard coded statements into a final program, but then you would be back to square one of not using a loop or recursion.
>someone has apparently come up with a mechanism to do something similar .. here
That would be recursion, which isn't allowed. Technically, any solution would involve some kind of loop or some kind of recursion, so unless you word the restrictions in such a way to allow the expected solution, it's quite literally an impossible problem.
A good trick is to use a third party program so that your program technically doesn't contain a loop or recursion. This relies on a common loophole of the program requirements.
Other tricky solutions are hiding the loop with goto, or hiding recursion with process spawning. Yet another is this evil little combination of tricks direct to Daniweb via my sleep deprived brain:
// Do not try this at home, kids
#include <stdio.h>
#include <stdlib.h>
int main ( int argc, char *argv[] )
{
if ( argc > 1 ) {
int n = atoi ( argv[1] );
if ( n > 0 ) {
char buf[BUFSIZ];
printf ( "%d\n", n );
sprintf ( buf, "\"%s\" %d", argv[0], n - 1 );
system ( buf );
}
}
return 0;
}