can't run simple code in C language in visual studio code

71 Views Asked by At

I've got the problem for the C language still I can't run my code and see the output after installing gcc and the code runner extension still, I can't run my simple code in Visual Studio code

my code is

#include <stdio.h>

int main() {
    printf("Enter your name: ");
    char name[100];
    scanf("%s", name);

    printf("Hello, %s! Welcome to the world of programming!", name);
    return 0;
}

show this warning the error popup and also in the terminal, I got this message in the terminal

     *  Executing task: C/C++: gcc.exe build active file 

Starting build...
C:\MinGW\bin\gcc.exe -fdiagnostics-color=always -g C:\Users\mostafa\Desktop\hellowworld.c -o C:\Users\mostafa\Desktop\hellowworld.exe
cc1.exe: error: unrecognized command line option "-fdiagnostics-color=always"

Build finished with error(s).

 *  The terminal process failed to launch (exit code: -1). 
 *  Terminal will be reused by tasks, press any key to close it.

can anyone help me with this?

i installed gcc and code runner extention for visual studio code

0

There are 0 best solutions below