Home >Backend Development >C#.Net Tutorial >What is the program format of C language?

What is the program format of C language?

coldplay.xixi
coldplay.xixiOriginal
2020-08-15 09:30:1615514browse

The c language format is: 1. C programs are executed starting from the main function; 2. The entire C program is composed of functions; 3. The content of the function body is in [{}]; 4. Each execution statement ends with [;]; 5. English letters are uppercase and lowercase.

What is the program format of C language?

c language format is:

1. Main function main

A C program is executed starting from the main function. It doesn't matter where the main function is placed.

2. The entire C program is composed of functions

main is the main function in the program. Of course, other functions can be defined in the program. Special operations are performed in these defined functions to make the function complete specific functions. Although it is feasible to put all the execution code into the main function, if it is divided into pieces and each piece is represented by a function, then the entire program will look structured and easy to observe and modify.

3. The content of the function body is in "{}"

Each function must perform a specific function. C language uses a pair of curly brackets to represent the program At the structural level, it is important to note that the left and right braces must be used accordingly.

4. Each execution statement ends with ";"

5. English letters are case-sensitive

In the program, you can use English uppercase letters or English lowercase letters. But in general, lowercase letters are used more because they are easier to see. However, capital letters are often used when defining constants, and the first letter is sometimes capitalized when defining functions.

6. The use of spaces and blank lines

The function is to increase the readability of the program and make the program code arrangement reasonable and beautiful.

Related learning recommendations: Programming video

The above is the detailed content of What is the program format of C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn