Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitscript authored Sep 15, 2022
1 parent 144db75 commit 3a358fd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 03Day-FunctionArgument.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 < 0.9.0;

//Create FunctionArgument Contract
contract FunctionArgument{
//Create a state variable of uint type (need not to be public).
uint num =10;
//Create a set ( ) and with one argument. And set the value of the created state variable with the value passed as an argument to the set ( ).
function set(uint _item) public {
num=_item;
}
//create another function get ( ) which returns the value of the state variable.
function get() public view returns(uint){
return num;
}
}

0 comments on commit 3a358fd

Please sign in to comment.