I am fairly new to C coding and cannot get a simple C hello world code to work with Visual Studio Code. The code looks like this:
#include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}
and I get two error messages:
line 2: syntax error near unexpected token `('
line 2: `int main() {'
Any suggestions on what can be going wrong?

test. You need to run that executable not the C code. If you want to do that from VS, either define a new task or follow the below answer. But if you want to run from terminal, see How do I run my C program? – Kulfy Nov 09 '20 at 12:00-oin task definition) unless build task is modified. So,a.outmight be irrelevant unless OP compiles usinggcc fileNameonly. – Kulfy Nov 09 '20 at 12:02