Section 22 Control Structure and Flow Chart

1. The three basic structures of the flowchart

2. Use a flowchart to describe the program design plan

"Program flow chart" is a traditional algorithm representation method. The program flowchart uses graphical symbol boxes to represent various operations of different nature, and uses flow lines to connect these operations.

#include <stdio.h>
int main()
{
    
    
	int a, b, c;
	scanf_s("%d %d", &a, &b);
	if (a > b)
	{
    
    
		c = a;
	}
	else
	{
    
    
		c = b;
	}
	pritnf("max=%d", c);
}

3. Examples of flowchart structure

Example 1: Sequence structure

Example 2: Single branch structure

Example 3: Double branch structure

Example 4: Nested branch structure

Example 5: Loop structure

Guess you like

Origin blog.csdn.net/m0_51439429/article/details/114899771