are there any other ways to reduce the program size
Yes. Write it in assembly instead of C++.
But seriously, some tips:
- Avoid float / double - the floating point library adds loads of bulk.
- Don't use variables bigger than you need. The processor is 8-bit. Anything bigger than a BYTE or CHAR uses extra instructions to emulate a larger value.
- Think about the flow of your program. Write it tight, and the resultant program will be tight.