Uploaded January 2025 | Updated November 2026, 1 day ago
In this beginners C Programming Language tutorial, we walk through the process of downloading and installing the C/C++ compiler and other necessary tools using mingw-w64 and msys2 for running C programs on your computer.
Command used in this video
Install gcc compiler : pacman -S mingw-w64-ucrt-x86_64-gcc
Install gdb debugger : pacman -S mingw-w64-ucrt-x86_64-gdb
The first step involves opening any browser, such as Microsoft Edge, and navigating to the website msys2.org. This platform allows you to download and install the GNU Compiler Collection (GCC), which is essential for compiling C programs.
Once on the MSYS2 website, you need to download the latest installer and run the setup. During installation, you can click through the prompts to proceed with the default settings, and once the installation is complete, you’ll be given the option to launch MSYS2 immediately.
After opening MSYS2, the first task is to update all the installed packages. To do this, you will execute the command `pacman -Syu`, which checks for updates and installs them. After completing the first round of updates, it’s a good idea to run the command again to ensure everything is fully up to date.
Next, you will install the necessary toolset for C and C++ programming. The command for this is `pacman -S mingw-w64-ucrt-x86_64-gcc`, which will install the GCC compiler. Once that’s done, you’ll also need to install a debugger. This can be done by executing the command `pacman -S mingw-w64-ucrt-x86_64-gdb`. Both commands will prompt you to confirm the installation by typing "Y."
After installing the compiler and debugger, we proceed to the final step, which involves updating the system's environment variable to include the path to the newly installed programs. You’ll need to open File Explorer, navigate to the msys64 folder, and copy the path to the "bin" folder where the GCC and GDB binaries are located. Then, in the "Edit Environment Variables" settings, you add this path to the system's "Path" variable.
To confirm the installation, you can open the terminal and check the versions of GCC, G++, and GDB by typing `gcc --version`, `g++ --version`, and `gdb --version`. If everything has been installed correctly, these commands will return the respective version information without any errors.
That’s all for this video! In the next tutorial, we’ll explore how to install and set up a code editor for writing and running C programs.
Our Website
LearningLad.com
Social Media
Facebook facebook.com/LearningLad
Twitter twitter.com/LearningLadEdu
Instagram instagram.com/LearningLadOfficial
In this beginners C Programming Language tutorial, we walk through the process of downloading and installing the C/C++ compiler and other necessary tools using mingw-w64 and msys2 for running C programs on your computer.
Command used in this video
Install gcc compiler : pacman -S mingw-w64-ucrt-x86_64-gcc
Install gdb debugger : pacman -S mingw-w64-ucrt-x86_64-gdb
The first step involves opening any browser, such as Microsoft Edge, and navigating to the website msys2.org. This platform allows you to download and install the GNU Compiler Collection (GCC), which is essential for compiling C programs.
Once on the MSYS2 website, you need to download the latest installer and run the setup. During installation, you can click through the prompts to proceed with the default settings, and once the installation is complete, you’ll be given the option to launch MSYS2 immediately.
After opening MSYS2, the first task is to update all the installed packages. To do this, you will execute the command `pacman -Syu`, which checks for updates and installs them. After completing the first round of updates, it’s a good idea to run the command again to ensure everything is fully up to date.
Next, you will install the necessary toolset for C and C++ programming. The command for this is `pacman -S mingw-w64-ucrt-x86_64-gcc`, which will install the GCC compiler. Once that’s done, you’ll also need to install a debugger. This can be done by executing the command `pacman -S mingw-w64-ucrt-x86_64-gdb`. Both commands will prompt you to confirm the installation by typing "Y."
After installing the compiler and debugger, we proceed to the final step, which involves updating the system's environment variable to include the path to the newly installed programs. You’ll need to open File Explorer, navigate to the msys64 folder, and copy the path to the "bin" folder where the GCC and GDB binaries are located. Then, in the "Edit Environment Variables" settings, you add this path to the system's "Path" variable.
To confirm the installation, you can open the terminal and check the versions of GCC, G++, and GDB by typing `gcc --version`, `g++ --version`, and `gdb --version`. If everything has been installed correctly, these commands will return the respective version information without any errors.
That’s all for this video! In the next tutorial, we’ll explore how to install and set up a code editor for writing and running C programs.
Our Website
LearningLad.com
Social Media
Facebook facebook.com/LearningLad
Twitter twitter.com/LearningLadEdu
Instagram instagram.com/LearningLadOfficial
![User Input for Arrays in C Using For Loop | Read & Display Array Elements
Learn how to take user input for an array using a for loop in C programming and how to display all the array elements using another loop.
In this tutorial, we create an integer array and use a for loop to go through each array element. Instead of manually accessing every index and assigning values individually, we use an index variable that starts from 0 and increases with every iteration.
You will learn how to use scanf() to read an integer from the user and store it directly in a specific array element. We use the address-of operator with numbers[index] to provide scanf() with the address of the required array element.
After taking input for all the elements, we use another for loop to access and display each array index and its corresponding value using printf().
We also discuss why the loop condition uses index less than array size and how an index variable declared inside a for loop has scope limited to that loop.
At the end, you can practice by modifying the program to display element numbers instead of indexes while taking input and display the array elements in reverse order.
Our Website
https://www.LearningLad.com
Social Media
Facebook https://www.facebook.com/LearningLad
Twitter https://www.twitter.com/LearningLadEdu
Instagram https://www.instagram.com/LearningLadOfficial User Input for Arrays in C Using For Loop | Read & Display Array Elements](https://i.ytimg.com/vi/BNK_Sizh-Pg/mqdefault.jpg)









