-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.sol
More file actions
43 lines (29 loc) · 782 Bytes
/
operators.sol
File metadata and controls
43 lines (29 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.5;
contract Operators{
uint x = 10;
function addition(uint a, uint b) public pure returns(uint){
return a + b;
}
function subtraction(uint a, uint b) public pure returns(uint){
return a - b;
}
function multi(uint a, uint b) public pure returns(uint){
return a * b;
}
function div(uint a, uint b) public pure returns(uint){
return a / b;
}
function mod(uint a, uint b) public pure returns(uint){
return a % b;
}
function incre() public returns(uint){
return ++x;
}
function decre() public returns (uint){
return --x;
}
function valueOfX() public view returns(uint){
return x;
}
}