Before writing your first C program, you need to create the project first, so here I am going to create the project on Dev-C++ and mentioning all the steps. A project can have multiple files or a single file depending on the requirement.
Note: If you don’t have installed Dev-C++ yet, see this article, Install Dev-C++
Steps to create a project on Dev-c++:
Click on the Dev-C++ shortcut and Go to File > New > Project. See the below screenshot.
After clicking on the new project a window will open, where we need to select application and language type. Here also need to write the project name. Here I am creating a console application and select C as the programming language for the project. Here the project name is “FirstProgram”.
In the next window enter the file name as “main” (later you can add more fille as the requirement).
Once the project is created, Dev-C++ will look like below screenshot.
Now write your code in the main function, I am printing here message “hello aticleworld” using the printf (standard library function used to display the message on console).
After writing the code, you have to save your program. In Dev-c+ +, you can save the program by pressing Ctrl + S or hitting save icon in the toolbar.
Compile the program by selecting Execute > Compile from the menu bar or by hitting F9. If compilation succeeds, you will see some messages on the compile Log tab of the Logs Window.
Notice the line of the log which says “Errors: 0, Warnings: 0 “. It means that the program is compiled successfully without any errors and warnings.
If the programme compiles successfully, then run the program by selecting Execute > Run from the menu bar or by hitting F10.
When you run the program, then the command window will open and display the message.
Recommended Articles for you:
- How to use if condition.
- C language character set.
- Elements of C Language.
- Data type in C language.
- Operators with Precedence and Associativity.
- How to pass an array as a parameter?
- Memory Layout, you should know .
- File handling, In a few hours.
- Replacing nested switches with the multi-dimensional array
- How to access a two-dimensional array using pointers?
- Brief Introduction of switch case.
- 100 C interview Questions.
- Function pointer, a detailed guide.
- How to use the structure of function pointer in c language?
- Function pointer in structure.
- Pointer Arithmetic operation.
- Brief Introduction of void pointer.