How to run the first code in C language?

Structure of C Program

If you have just started learning C Program and want to write your first program.

If you are just a pure beginner and no nothing about C language. Read the article Introduction To C Language.

We have come up with a comprehensive article to solve your problem.

In a C Program, we have four basic sections on which we have to focus and write your code.

Structure of C Program

1. Link Section – In the Link section, we mainly include the header files that we need during the execution of the program. For Example: In the above image we added stdio.h and conio.h. Stdio.h is used to perform Data Input / output function. Conio.h is used to clear the screen or holding the screen for getting the input from the user.

2. Global Declaration – It is not the mandatory section of the program. Your program will run smoothly if you do not have this section. Global variables are the variables that have the scope over the whole program.

3. Main Section – It is the most important section of the program. All the statements through which we will manipulate the data and will get the required output. Everything is written in the main section.

4. Comments – It is very important to add comments in your code as it will increase your code readability and will make your program more effective.

Example – Structure of C Program

This is the basic Structure Of the C Program. After knowing all the Concepts of C Program. Try yourself to make some of the basic programs in C Language. Some of the recommended programs are :

  1. C Program to add two numbers
  2. C Program to reverse a number
  3. C Program to reverse a string

After reading the article, try to make these programs yourself and make some changes accordingly.

Recommended Posts –

  1. Introduction to Java and Installation in Windows
  2. Difference between c and c++

Leave a Reply

Your email address will not be published. Required fields are marked *

Close Bitnami banner