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

What are the properties of string?

568


What is an ienumerable in c#?

629


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

566


What are the commonly used i/o classes?

620


Why delegates are type safe?

594






What is scope c#?

533


Explain the difference between abstract class and interface.

685


i want o/p 011242110 in c# code.

1731


List some of the classes used by system.data namespace?

520


Explain how can I get around scope problems in a try/catch?

564


how background thread access to ui control?

677


How does dictionary work in c#?

556


What is code verification?

615


What is sqladapter c#?

626


What are the 2 types of data types available in c#?

581