A Basic program that illustrates Smart Contracts in Ethereum

A Basic Solidity contract to identify the account address

pragma solidity ^0.4.0;
contract Myaddress{

address mine;
function Myaddress() public{

function show_address() public returns (address){
return (mine);

This is the best possible beginner code to understand smart contract. In the first line
pragma solidity ^0.4.0;
pragma is a preprocessor and and it tells us the compiler version is 0.4.0
Just like creating class and objects in Java and other programming languages you can create contract using

contract <contract-name>{

Address type is a base for all contracts and it holds 20 byte value.

address x=0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2;

Execute the above simple contract in the Inbrowser Solidity IDE.


Run the program by selecting Run option in the right menu and click create object to initiate the contract.
In the log message you can see the current address of your account number.

Solidity log messages