Hello bansal1232, I think you have not declared the header file which has the function to_string in it i.e cstring or you can use bits/stdc++.h See here also
Works fine with me. Either you have not included the appropriate header files or to_string is in a different scope. Try std::to_string or use the namespace std globally. Third option: ther’s something else wrong. In that case your source would be helpful.
@bansal1232 I think you lack the header which contains definition of to_string method. I would suggest you to follow my previous answer on this post and patch the corresponding headers to use to_string
include bits/stdc++.h in your program.it includes almost all the libraries like string, algorithm, set, multiset etc.
Also don’t forget to write “use namespace std;”