Home >Backend Development >C#.Net Tutorial >Are #define and printf C statements?
##Are define and printf c statements?
#Both define and printf are not c statements , #define is a preprocessing command, and printf is a function in the standard library.
#C language statements are used to issue operating instructions to the computer system. A statement generates several machine instructions after compilation. C statements are used to complete certain operating tasks.
C statements can be divided into the following five categories:
1. Expression statements
Expression statements consist of expressions It is composed by adding a semicolon ";".
Its general form is: expression; executing an expression statement is to calculate the value of the expression and perform side effects.
2. Label statements
There are three types of label statements:
Tag name: statement
case constant expression: statement
default: statement
Description: The case statement and default statement only appear in the switch statement.
3. Loop statements
There are 4 types of loop statements, namely
while ( expression ) statement do statement while ( expression ) ; for ( expression(opt) ; expression(opt) ; expression(opt) ) statement for ( declaration expressionopt ; expressionopt ) statement
Loop statements are used to implement the loop flow of the program.
4. Compound statement
A statement enclosed by brackets {} is called a compound statement. Compound statements should be regarded as a single statement in the program rather than multiple statements. For example,
{ x=y+z; a=b+c; printf(“%d%d”,x,a); }
is a compound statement.
5. Jump Statements
There are 4 types of jump statements, namely
goto 标签 ; continue ; break ; return 表达式(可选) ;
Jump statements control the program to jump to another place implement.
Recommended learning: c language video tutorial
The above is the detailed content of Are #define and printf C statements?. For more information, please follow other related articles on the PHP Chinese website!