Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the program flow structure of C++?

Shulou Source: shulou.com Published: 2022-06-01 17:30:16 10月03日 Update

This article mainly introduces the relevant knowledge of what the program flow structure of C++ is, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this C++ program process structure. Let's take a look.

Preface

C _ + supports three basic program running structures: sequence structure, selection structure and loop structure.

The sequential structure is to write the code along the way, and I don't want to talk about it.

1 Select structure 1.1 if statement (no different from C)

Function: execute statements that meet the condition

There are three forms of if statements:

Single-line format if statement

Syntax:

If (condition) {statement that meets the condition} # includeusing namespace std;int main () {/ / user enters a score, if the score is greater than 600, it is deemed to be admitted to a university, and output / / 1 on the screen. User input score int score = 0; cout score; cout

Tags: Statement loop condition input expression structure score result university grammar one book program action Category weight user random number flow heaviest variable Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Xiaomi Redmi NVidia OPPO Reno