+ 1

help me! I do not know what happened to my code. I want to put information from scanf into printf but the result is not as I e

https://code.sololearn.com/c7zoXxecgIl7/?ref=app help me! I do not know what happened to my code. I want to put information from scanf into printf but the result is not as I expected. thanks everyone.

8th Nov 2019, 4:29 AM
Phuong Pham
Phuong Pham - avatar
3 Answers
+ 8
I guess problem is, you're using scanf() statment at last, which isn't valid. You have to take inputs before you print them. So move scanf() statement right before print statement, it worksđŸ€“
8th Nov 2019, 4:52 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 5
Phuong Pham, you are printing the values before reading them, so it displayes whatever values where stored in that address (known as garbage values) So to correct that just like 🎃 Dark Knight 🎃 said, put scaf first https://code.sololearn.com/coJWqfyET7A2/?ref=app
8th Nov 2019, 5:44 AM
Arsenic
Arsenic - avatar
+ 1
Thank you very much, I understand😉😆😆
8th Nov 2019, 1:35 PM
Phuong Pham
Phuong Pham - avatar