Array Summary
Part of the Fundamentals section of Coddy's Solidity journey. Lesson 40 of 53.
Challenge
MediumStore a, b and c in a memory array. Use a loop to find the total and the greatest value. Print total first, then the greatest value.
The tests pass arguments to main in this order: uint256 a, uint256 b, uint256 c. Each test starts with fresh contract state.
Use console.log for the requested output. Print only the requested values, one per line, with no extra labels unless the task specifies them.
Try it yourself
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "forge-std/console.sol";
contract Main {
function main(uint256 a, uint256 b, uint256 c) external view {
// Write your solution here.
}
}All lessons in Fundamentals
Practice on your own: Solidity playground