Pure Programmer
Blue Matrix


Cluster Map

Sequence

L1

This page is under construction. Please come back later.

In programming languages we have three ways to control the flow of statements: Sequence, Selection and Iteration. Sequence is the simplest and most basic flow control mechanism. It simply means that statements are executed sequentially in the order they appear in the program.

Sequence1.rs
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]

fn main() {
	let mut x:isize = 1;
	println!("x: {}", x);
	x = 2;
	println!("x: {}", x);
	x = 3;
	println!("x: {}", x);
}

Output
$ rustc Sequence1.rs $ ./Sequence1 x: 1 x: 2 x: 3

Questions

Projects

More ★'s indicate higher difficulty level.

References