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 26, 2022
1 parent 1b33853 commit 49f0bc8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 14Day-ArrayToEven.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.9.0;

contract Day2 {
//Create a function even(array, length of array) . This even() will take two arguments - a dynamic uint type array and length of the array.
function even(uint256[] memory arr, uint256 len)
public
pure
returns (uint256[] memory)
{
//The even() will multiply each element of array with 2
for (uint256 i = 0; i < len; i++) {
arr[i] = 2 * arr[i];
}
return arr;
}
}

0 comments on commit 49f0bc8

Please sign in to comment.