+ 1
Why this doesnt work?
I really dont understand why it didnt work?someone who knows the ansswer help me https://code.sololearn.com/WPnsfbcG6Bhr/?ref=app
1 Answer
+ 3
You are calling the constructor first and then you are taking values from user. When you call constructor initially, it is passing values in a and b which at that moment is undefined.
Therefore, the values in output is undefined.
Take the values from user before calling constructor, your program will run fine then.