Are #define and printf C statements?

angryTom
Release: 2020-02-08 14:31:00
Original
9491 people have browsed it

Are #define and printf C statements?

##Are define and printf c statements?

#Both define and printf arenot 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
Copy after login

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); }
Copy after login

is a compound statement.

5. Jump Statements

There are 4 types of jump statements, namely

goto 标签 ; continue ; break ; return 表达式(可选) ;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!