0

I have this code for the program to test a for loop and continue statement in c.

#include <bits/stdc++.h>
using namespace std;

    int main(){
    for(int out=0; out<=100; out++)
    {
        if(out%3==0)
        {
            continue;
        }
        cout<<out;
    }
}

When I try to run it in vs-code, it runs the previous code that I had before this. That previous code is about comparing three numbers and finding out the greatest out of the three. So it asks for the input of three numbers in the terminal. Now if I try to run it using the output screen, it says the code is already running. So what am I supposed to do here?

  • Have you remembered to update your JSON configuration files? I really recommend you use separate directories and separate configuration files for each different assignment or project. – Some programmer dude Mar 01 '21 at 08:11
  • On a side-note, [`#include ` is a nasty habit](https://stackoverflow.com/questions/31816095/why-should-i-not-include-bits-stdc-h), please don't do that. And related to that, [`using namespace std;` is also not good](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice). – Some programmer dude Mar 01 '21 at 08:13
  • some guesses: you haven't saved your current file so your previous file is being run. You haven't compiled your new file so your old file is still being run – Alan Birtles Mar 01 '21 at 08:13
  • One Guess: you haven't saved the file Second guess: you are not recompiling the file and just running a.out – Harsh Chaturvedi Mar 01 '21 at 08:58
  • @Someprogrammerdude I have newly installed the vs code as well as mingw compiler. I have set the environment variables. What do you mean by separate directories and configuration files for each different assignment or project? – Puru Raj Singh Uppal Mar 03 '21 at 11:11
  • @HarshChaturvedi How are you supposed to compile a file here? I click on run and then it just stays there. – Puru Raj Singh Uppal Mar 03 '21 at 11:16
  • @Someprogrammerdude what to use instead of the two things that you mentioned above? – Puru Raj Singh Uppal Mar 03 '21 at 11:47

0 Answers0