Quiz: Functions in Solidity

Assess your knowledge on the usage of functions in Solidity.

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;
}
Question 1 of 50 attempted

Get hands-on with 1200+ tech skills courses.