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
How more than one version of an assembly can keep in same place?
Is array value type in c#?
Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?
What is the relation between classes and objects?
What is difference between ienumerable and iqueryable in c#?
What is the use of main method in c#?
How many types of constructors are there in c#?
Why do I get a syntax error when trying to declare a variable called checked?
What is int parse in c#?
Can we customize the serialization process?
What are methods in C#?
Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).
Difference between Value type & reference types ? and give the example in .Net?
How can it prevents DLL Hell assembly versioning in .NET?
How many types of polymorphism are there?