adspace


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 / nvk

The Variable Sum Is Not defined

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you inherit a class into other class in c#?

993


What is expression tree in c#?

998


Which namespaces are necessary to create a localized application?

1142


Why can't we use a static class instead of singleton?

954


What is an abstract class c#?

969


How to assign Null value to Var?

1063