Local Variable Assignment Help

Assignment Help: >> Functions, Arguments and Overloading - Local Variable

Local variable

Variables that are declared inside a particular block or function are known as local variables.

Example

void funct (int i, int j)

{

int k,n; //local variable

// body of the function

}

In the given example The integer variables k and n are defined inside a function block of the funct( ). All the variables to be used  inside  a  function block  have to  be  either  defined at  the starting of  the block itself or before using in a statement. A Local variables are referred just only the particular part of a block or a function. Similar variable name might be given to different parts of a function or a block and every variable will be treated as a various entity.

Example

funct1 (float a, float b)

{

float x,y;

x = 23.00;

y = 10.9;

}

funct2 (int i, int j)

{

float x,y;

x = 56.00;

y = 1.90;

}

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd