Windows 10 is a widely used operating system that can handle a wide range of jobs, including coding. However, there is still a lot of debate over whether Windows 10 is the best choice for people who are interested in software development.
We think that Windows 10 is great for coding because it supports various tools and languages. It also features significant improvements over the previous versions of Windows and offers a lot of customization and compatibility choices. Moreover, there are numerous benefits to coding on Windows 10 as opposed to Mac or Linux.
This article will help you with a programming tutorial in Windows 10, so brace yourself!
If you need more help with computer programming, get in touch with assignment helpers from CWAssignments.com to have your projects done online.
Running Your First Program On Windows
In essence, computers can’t understand windows 10 programming tutorial languages. This demands the use of a compiler that translates the written program into a language that the computer can understand. The compiler, after translating the program, converts the code into an executable file, which is something you can run and do anything with. First, we’ll install a compiler to get started.
Things You Will Need
- A computer with Windows 10 installed
That’s all you need to start writing your code! Let’s download the compiler now that interprets your code.
Installing The GCC
Go on to: http://gcc.gnu.org/install/
Here, you will find lengthy installation details. If you just want to download it, you can go to: http://www.netgull.com/gcc/releases/gcc-4.8.1/
There you will find a file named “tar.gz”. This is a compressed file with a different compression than “.zip”. You will have to decompress the file with something like WinZip and follow the installation details mentioned on the website.
Once you’ve installed the compiler and verified it (coming in the next step), follow the upcoming instructions.
Open Command Prompt
There are two methods to go about this.
1st Method With Vista or Windows 7
Click on Start Menu. Type ‘cmd’ and click on Command Prompt.
This should open up a black window with white text that looks very old and ominous.
In case your start menu is different, follow the method given below.
2nd Method Using Task Manager
Open your task manager by pressing either CTRL + ALT + DELETE or CTRL + SHIFT + ESC (If there’s a button that says “Task Manager”, click it). Look at the top of the window that opens up and look for “Run” and press it. If there’s no button, click
File>Run. A new window would appear with just a text field. Type in “cmd” without the quotes and Command Prompt will open.
Verifying The GCC
Log on to the command prompt window. To verify if GCC is installed or not, simply type “GCC” without the quotes and press enter. If the message:
‘gcc’ is not recognized as an internal or external command, operable program or batch file
appears, that means that the GNU C Compiler didn’t get installed properly, and you will have to re-install the GCC or troubleshoot what went wrong.
If the message:
gcc: fatal error: no input files
appears, it means that the compiler is installed, and we can move forward.
Open A New Text File
Now you need to open a new text document for writing your program. The easiest method to do this is by right-clicking the desktop and heading towards New>Text Document. This will open an empty text document on the desktop.
You can do this another way by simply opening the notepad.
Simply go to:
In the new file, type or copy this text:
Once you’ve done that, click File>Save As. This step is crucial. You can call the file whatever you like, but always set the type to “all files” and end the program with the extension “.c”. This is so the compiler knows what the file is. When the program gets compiled and is ready to run, it will print the sentence “Hello World!” in the window of the command prompt. When you save the source code file, follow the next step.
In case you don’t mind what your code is named, simply type:
in the command prompt window. In case of any errors, open the code file again in the notepad and see if everything was copied or typed correctly. You also want to check if the file was saved correctly or not (with “.c” extension). When the code is compiled this way, it gets “a.exe” by default.
Naming the code involves a bit more than just the previous step. You need to type:
gcc -c HelloWorld.c
The compiler will form an object file with a “.o” extension in it. This step is important if you have codes with several files in them. Next type:
gcc -o HelloWorld HelloWorld.o
The “HelloWorld” part is simply what the program is going to be called, while everything coming after it will be the constituent files. Name your file whatever you like without using spaces.
Once you’ve completed this step, it means that your code has been compiled, and you can go to the next step.
Run Your Code
Now comes the time to run the program for the first time!
The program you’ve run will print out the sentence “Hello World” in the window of the command prompt. If you used the last step and compiled the program with gcc HelloWorld.c all you have to do is type the letter “a”. If you had named your program, simply type the name of your file.
A Final Word
This article gave details about Windows 10 and running a program on it. Windows 10 is probably one of the most famous OS to run codes. If you’re a beginner, you’ll like this programming tutorial in Windows 10 for how easy it is.
Simply follow the steps in this tutorial to write and run your program and get started on your coding journey.