First C Programming.


First C Programming


Programming requires a computer and a compiler. Is not it similar to two? Both start with the beginning and the "mpe" contains the letters.
If you do not have a computer, then you could not read this article, is not it? Now a compiler is needed. A C compiler. That's compiling our code programming code.
Why do I need a compiler before. The computer can not read what we write. Computer Language Machine Language. This compiler changes our C programming to machine language.
We will use CodeBlocks IDE for writing and compiling C code. To download CodeBlocks, download the
codeblocks-12.11mingw setup_user.exe at the following link.
Then install it. Open. Then you can see the following.



If you are ready, you are ready to write code.

From here click on Create New Project.

Programming requires a computer and a compiler. Is not it similar to two? Both start with the beginning and the "mpe" contains the letters.

From here, select the Console application and click Go.


Now select C and click Next. Enter your project's name in Project Title box. Like hello Select the folder where you want to save your project from a folder to create project in box. Click Next Now click on Finish.
Now you will see your workspace on the right. Your projects will show up here. Click on the + sign of hello. Then click on the + sign of the source and click on main.c CodeBlocks will create a simple one code template for every project, to show it. Which will contain text.

#include<stdio.h>
int main()
{
printf("Hello world");
return 0;
}

Click our Build in the File menu and click on Build and Run for the code to compile and run our code. Then your C program will compile and run. And the output will be liked below:


If you can run the program above, then congratulate you and welcome to the fun world of programming. If you can not do it is not necessary to make it. Try a little again from the first. So will be. Let's explain how we are writing in the above code. The first line of our program is #include <stdio.h>. Include means to add anything. Stdio's full of standard input output. Stdio.h's .h is understood is a header file. And with the full line, which means to start standard input output. Stay after a few input output, you will say. The next line is int main (), it is called Main Function. When we run the program, start the work from the function function. So all programs have a (and only one) to have the main function. The beginning of the main function is to start with the second bracket. The main function is to finish with a second bracket. Writing the first line inside the second bracket's second bracket, we printf ("hello world!"); Here is a function of printf (). Printf means that print hasttted. This is a library function called the standard AUP function. Printf () is to print something on the console / screen. He will print what you will write on the double quotation mark. We are writing that line first at first #include <stdio.h>. How is printf () how to print anything, this is in the stdio.h file. After that we write another line Return 0; We're saying that Main is a function. The contract function has to have a return value. Which is a return of the function of the function's work. Return 0 means to zero return. After this, more details can be known when we will be able to face functions. Printf ("hello world!"); Or return 0; Statement for this. At the end of each statement, a semicolon (;) has to be given. If we do not give semicolons, then the compiler will be wrong and the program will not run. In the beginning of programming, many people forget to semicolon, then compile error "shows where the mistake has been trying to find out after. If a code is noticed, the small mistakes can be easily avoided. Now try to write this program by itself. Hello World Instead, try running with something as your name or wish.
Problems and Solutions:
code blocks IDE. It takes us compiler. Which will compile our C program. If the compiler does not have the installation, then I will show Irrigation.
Environment ERROR CAN'T FILD COMPILER Executable in yoursnigigd Search Path "GNU GCC" Compiler.
For this, you must download and install with your codeclocks with Mingw. By downloading and downloading the codeblocks-x.x.x mingw-setup.exe and in the downloadpapers, it will be resolved by the problem.
First C Programming. First C Programming. Reviewed by Tech-Wizard on July 09, 2018 Rating: 5

No comments