Skip to content

Instantly share code, notes, and snippets.

@ashokslsk
Created February 21, 2020 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashokslsk/f75126972dcb696fe44905a7a3658b3b to your computer and use it in GitHub Desktop.
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=
// 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;
}
}
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