C Language Basics : My first program


I am starting a new series on C programming with this article. We'll start with the basics of programming. I hope you will follow this writing as well as other YouTube channels and tutorials to learn C programming.

And don't forget to read my previous blog for some important ideas, which you can find by clicking here! SciEco

How do I start programming in C?

In the beginning you need a compiler to write and run your code. For this we will download Codeblocks from here according to our device from the link below. You must download the version (including compiler).

Download codeblocks

At the beginning of the programming, we look at a few examples without looking at A, B, C, D, then we will understand the explanation. Then gradually I will know the details.


Let's start with the first line of this program.

#include <stdio.h>

Here stdio means standard input output.

C has many library functions for input and output (eg scanf, printf) that are housed in a header file. The .h extension is used at the end of the name of the header file. To use these special functions, we need to include the header file at the beginning of the program. Later we will get acquainted with some more header files and get to know the details. From now on we will use this line at the beginning of all programs.

int main ()

The compiler will start reading the program from where the main () function is found and the return type of the program will be integer or int. We will find the details in the function topic. For now, it should be used in all programs.

{}

Everything in the whole program has to be written between these two parenthesis. int main () will be on the next line and next to the last line of the program.

/ *. * /

This is a comment. Whatever is written in the dot space between these two symbols will have no effect on the original program. In between you can write any of your writing or anything you need.

printf (“…… ..”);

printf means print function which indicates the program to display the text in the middle of your screen. Whatever is written between the double quotations (“”) will be displayed on the screen.

A semicolon at the end of each statement or instruction in C; Is to be used.

return 0;

Since the type of return of the main function is int type, it has to be written. We will know the detailed explanation of this in the topic of function.

Now we will see the output of the above code-

What we wrote in printf in the code above will show the output here.

The text below is not part of our code, so it may not be understood at this time.

Process returned 0 (0x0) execution time: 0.019 s

Press any key to continue.

Now that you understand the whole thing, you can now display any text on the computer screen through your C code. And it is through this small program that you begin your journey into the world of programming!


Welcome to Programming World!

Happy Coding !!

Post a Comment

0 Comments