Quote:
I am getting expected ouput:1,23,456,78910
No you're not. When running this program I get 4 rows of 1234 when input 4.
Quote:
when input:4,your program output:1,12,123,1234
I'm guessing that this is what your assignment is supposed to achieve. Since that's not what's going on I suggest you look into how to use the debugger on your system and find out
why that's not happening.
Other notes:
There's no prompt for input, so its not clear when the program is ready for input
main()
always returns an int, even if you don't say
return 0;
at the end, the compiler will add it for you, and you should always declare main accordingly.