Start C language learning and LinuxC language learning in Linux
Why C language learning in linux?
OK, let's star!
Step 1: open terminal and input vi hello. c to create a c source file.
Then we enter the VIM editor and write a helloworld code.
Input: wq save
Then we can compile the program and input gcc hello. c-o hello, which means to compile the previously written hello. c program named hello.
Then we run the program named hello to see if "hello world!" is displayed on the screen !"?
What if we encounter a compilation error? Or the previous helloworld code. Let's try to get the result of removing a semicolon.
As a result, the compiler successfully prompts us where an error occurred.
OK. Next, let's try a slightly more complex program:
This is the code for finding the maximum common divisor of two numbers. Next we compile and run
See how it works.
OK. Now, we can successfully start C Programming on linux.