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

What do you mean by sealed classes and static classes?

937


What does console writeline do?

855


What are the properties in c#?

883


What is polymorphism in c sharp?

931


How do you declare a method in c#?

889


What is difference between constants and read-only?

880


Between windows authentication and sql server authentication, which one is trusted and which one is untrusted?

927


What do multicast delegates mean?

954


What are static and dynamic variables?

1098


Can you use foreach iteration on arrays in c#?

1018


What is use of FormBoarderStyle Propertie

883


How can I check the type of an object at runtime?

921


Explain the use of virtual, sealed, override, and abstract method?

841


What is form feed and carriage return?

864


Explain the difference between the system.array.copyto() and system.array.clone()?

888