+ 2

[SOLVED] Please help with a code

Whenever I run this code, it shows some unwanted garbage value characters before the output. Can anybody kindly help? https://code.sololearn.com/c3f5BOIz697u/?ref=app Information about the code is given inside the code in the form of comments. Thanks in advance.

12th Dec 2017, 12:10 PM
DAB
DAB - avatar
2 ответов
+ 8
Add this line after the while loop. number[c] = '\0';
12th Dec 2017, 1:48 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 3
Problem solved. Thanks @Shamima
12th Dec 2017, 1:56 PM
DAB
DAB - avatar