Browse Source

docs(division_and_remainder): correct grammar

pull/1091/head
davhojt 2 years ago committed by Dav Hojt
parent
commit
f226f3b98a
  1. 21
      subjects/division_and_remainder/README.md

21
subjects/division_and_remainder/README.md

@ -2,21 +2,10 @@
### Instructions
Create a **function** `divide` that receives two i32 and returns a tuple in which the first element is the result of the integer division between the two numbers and the second is the remainder of the division.
### Notions
- [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types)
- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html)
- [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types)
### Expected Function
Create a **function** named `divide` that receives two `i32` and returns a `tuple`. The first element is the result of the integer division between the two numbers, and the second is the remainder of the division.
```rust
pub fn divide(x: i32, y: i32) -> (i32, i32) {
}
```
@ -45,3 +34,11 @@ $ cargo run
9/4: division = 2, remainder = 1
$
```
### Notions
- [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types)
- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html)
- [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types)

Loading…
Cancel
Save