// Solidity program to // demonstrate view // functions pragma solidity ^0.4.18; // Defining a contract contract Test { // Declaring state // variables uint num1 = 2; uint num2 = 4; // Defining view function to // calculate product and sum // of 2 numbers function getResult() public view returns(uint product, uint sum) { uint num1 = 80; uint num2 = 26; product = num1 * num2; sum = num1 + num2; } }
0.4.18