Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

class Program
{




void add()
{
int x=10, y=20;
fun();
Console.WriteLine("{0}", sum);

}

void fun()
{
int sum;
sum = x + y;

}
static void Main(string[] args)
{
Program f =new Program();
f.add();

}
}

Debug above program.....

Answer Posted / simhachalam

Actually you defined x,y variable in add() function so that
variables you can't access outside of method .finally u got
error is undefined variables x,y.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c# an open source language?

997


What is difference between === and ==?

882


What is class method c#?

901


What are virtual classes in c#?

960


Explain About a class access specifiers and method access specifiers.

986


what is method overloading in c#?

1052


What does int32 mean in c#?

901


What is the Signification of the "new " keyword in C#? example

949


What is a singleton unity?

982


Can namespace contain the private class?

931


Hello! How to do this: "Create manifest utility intended for creating update content files. Application should take a set of files as input parameter and generate XML based manifest file as output one." I use C# and vs.net 2003. It's urgent! Help please, thanks. Mayana

1931


Explain anonymous type in c#?

955


Ho we can see assembly information?

959


How long does it take to learn c# for unity?

904


Which programming language is best for desktop applications?

939