Does this count as one variable?
Code:
struct {
char buff[BUFSIZ];
int linenumber;
} singleVariable;
> After the user inputs' \n' the output should look like this 01: <input>
Where were you planning to store input up to the point where you receive the \n?
Code:
printf("%02d ",++linenum);
while((c=getchar())!=EOF) {
putchar(c);
if ( c == '\n' ) printf("%02d ",++linenum);
}
> I am only allowed to use putchar one local variable and a global variable.
Pointless contrivances which aren't teaching you how to program.