ok.. im assured that the input will always be digits, and im not sure how to break out of both loops from the inner one. But my main problem is still there, when i enter a large number, the final digit isnt printed.

please help

Code:
#include <stdio.h>

#define maxSize 10001

int main (int argc , char** argv) {

	int counter = 0;
	char myArray[maxSize];
	
	do {

		if (fgets(myArray, maxSize, stdin) == NULL)
			break;
		
		for (counter=0; counter<maxSize; counter++) {
			
			if (myArray[counter] != '\n' && myArray[counter] != '\0') {
				printf("&#37;d", myArray[counter]-'0');
			}
			else
				break;
		}

	}
	while (myArray[counter] != '\n' && myArray[counter] != '\0');
	
	return 0;
}