can't run c++ codes in vs code

Anonymous
2022-12-03T23:43:35+00:00

I watched a bunch of videos on how to run c++ codes in vs code but none of them helped me. I have tried doing a bunch of things like reinstalling vs code, changing task.json and launch.json file, reinstalling mingw files and all that and I still cant run any c++ program and I dont know what seems to be the problem. It would be great if anyone could help me.
here's a simple helloworld program for reference

Windows for home | Windows 11 | Devices and drivers

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. _AW_ 64,236 Reputation points Volunteer Moderator
    2022-12-03T23:51:35+00:00

    It seems that it's running fine, just you are not pausing the program to be able to see the output.

    On the line after cout << "Hello World"; put cin.get();

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-12-04T00:50:43+00:00

    it worked...thank you for your help...i really appreciate it..

    0 comments No comments
  2. _AW_ 64,236 Reputation points Volunteer Moderator
    2022-12-04T01:29:46+00:00

    You're welcome. :)

    0 comments No comments