Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Operadores Aritméticos

Usados para cálculos matemáticos básicos.

+

#![allow(unused)]
fn main() {
let adi = 1 + 1;
println!("Adição = {:?}", adi);
}

-

#![allow(unused)]
fn main() {
let sub = 2 - 2;
println!("Subtração = {:?}", sub);
}

*

#![allow(unused)]
fn main() {
let mul = 3 * 3;
println!("Multiplicação = {:?}", mul);
}

/

#![allow(unused)]
fn main() {
let div = 4 / 4;
println!("Divisão = {:?}", div);
}

%

#![allow(unused)]
fn main() {
let rest = 5 % 5;
println!("Resto Divisão = {:?}", rest);
}