-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
144db75
commit 3a358fd
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
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
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; | ||
} | ||
} |