Quiz: Functions in Solidity

Assess your knowledge on the usage of functions in Solidity.

We'll cover the following...
Technical Quiz
1.

Which is the correct way to define a function called sum that accepts two integers and returns the sum?

A.
function sum(string a, uint b) public pure returns(uint) {
        return a + b;
}
B.
function sum(uint a, uint b) public pure returns(uint) {
        return a + b;
}
C.
function sum(uint a, uint b) public pure {
        return a + b;
}
D.
function sum = (uint a, uint b) public pure returns(uint) {
        return a + b;
}

1 / 5