Input file addition in vs code

how can i attach input file for input values when i am using vs code for windows?
similarly, how can I get an output file containing outputs in vs code for windows?

hello @pushaansharma

add these lines just in the start of ur int main

#ifndef ONLINE_JUDGE
  
    // For getting input from input.txt file
    freopen("input.txt", "r", stdin);
  
    // Printing the Output to output.txt file
    freopen("output.txt", "w", stdout);
  
#endif

and then u will be able to read input from input.txt file and write ouput to output,txt file