1
votes

The code results in same output.

pragma solidity ^0.5.0;
contract mycontract
{

   function add(uint c, uint d) public pure returns(uint)
  { uint e=c+d;


   return e;

  } 
   function add(uint j, uint k) public view returns(uint)
  { uint f=j+k;


   return f;

  } 

}
1

1 Answers

1
votes

pure does not view nor modify state. i.e. it can only use what is provided to it to run. view cannot modify state, but can look it up.