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
What's the difference between abstraction and encapsulation?
In object oriented programming, how would you describe encapsulation in c#?
Why generics are used?
What is ilist c#?
Is learning c# hard?
What does assert() do in c#?
Difference between StackPanel and RelativePanel ?
Are attributes inherited c#?
What is a must for multitasking
How can we sort an array in c#?
If you want to convert a base type to a derived type, what type of conversion do you use?
How long can loop recorders stay in?
What is using directive in c#?
What is the difference between CONST and READONLY?
What is native image generator (ngen.exe)?