Why this code is not working ? (C Programming)

Question:
The program seems to be correct still i am getting an error when i run it.
Same thing is happening while using looping statements.
Repl link:
https://replit.com/@ssk53573/c-program-SE#while.c

#include <stdio.h>

int main() {
  int i;
  
  for (i = 0; i < 10; i++) {
    if (i == 4) {
      continue;
    }
    printf("%d\n", i);
  }   
  
  return 0;
}

The error is in the main.c file, and Replit runs main.c by default.

To change the file to run, just click the next to “Files” then click “Show hidden files”. Next click on the .replit file and finally you can change the entrypoint to whatever file you want to run.

You can also change the second line from run="run_command_for_lang main.c" to run="run_command_for_lang fileIWantToRun.c", though it won’t have an effect for languages with interpreters as shown in the comment on line 1.

Images

Dots

Show hidden files

edited

Also see the docs on how to configure a Repl: https://docs.replit.com/programming-ide/configuring-repl

3 Likes
1 Like