How to use Local Variable for whose values are present till function is executing in solidity ?

  How to use Local Variable for whose values are present till function is executing in solidity ?


pragma solidity ^0.5.0;

contract SolidityTest {

   uint storedData; // State variable

   constructor() public 

{

      storedData = 10;   

   }

   function getResult() public view returns(uint)

{

      uint a = 1; // local variable

      uint b = 2;

      uint result = a + b;

      return result; //access the local variable

   }

}

Comments

Last 7 Days

How to use referrerpolicy Attribute value ( no-referrer-when-downgrade ) with < iframe > tag in HTML ? with example

Smart contract code for Anyone can send coins to each other without a need for registering with a username and password with help of Ethereum keypair

How Artificial Intelligence Is Changing the World: A Complete Pro Guide

How to Convert Image to PDF on iPhone (Free & Easy Methods) | ThinkforU

Why People Use iLovePDF Merger and Better Online Alternatives

Why Converting PDF to Text Improves Productivity (With Examples)

How Text Conversion Tools Work and Why They Are Useful

How to use referrerpolicy Attribute value (strict-origin ) with < iframe > tag in HTML ? with example

Why Word Count Matters and How to Check It Online