Created
February 21, 2020 05:47
-
-
Save ashokslsk/f75126972dcb696fe44905a7a3658b3b to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.0+commit.acd334c9.js&optimize=true&gist=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple addition with solidity | |
pragma solidity ^0.4.0; | |
contract AddInteger{ | |
uint private result; | |
function addition(uint _operand_1, uint _operand_2)public constant returns(uint){ | |
result = _operand_1+_operand_2; | |
return result; | |
} | |
function division(uint _operand_1, uint _operand_2) public constant returns(uint){ | |
result = _operand_1/_operand_2; | |
return result; | |
} | |
function multiplication(uint _operand_1, uint _operand_2) public constant returns(uint){ | |
result = _operand_1*_operand_2; | |
return result; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0; | |
contract SimpleStorage{ | |
uint a; | |
uint b; | |
uint c; | |
function set( uint balu, uint bunny)public{ | |
a = balu; | |
b = bunny; | |
} | |
function add()public constant returns(uint){ | |
c = a+b; | |
return c; | |
} | |
function sub()public constant returns(uint){ | |
c = a-b; | |
return c; | |
} function mul()public constant returns(uint){ | |
c = a*b; | |
return c; | |
} function div()public constant returns(uint){ | |
c = a/b; | |
return c; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment