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 is a static in c#?
What is the use of convert toint32 in c#?
What are circular references? How garbage collection deals with circular references.
List the fundamental oop concepts?
Can we instantiate abstract class in c#?
What is the use of 'as' Keyword in C# ?
What are the properties of string?
Who is a accessibility modifier “protected internal†available to ?
what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?
Can I do things in il that I can't do in c#?
Why do we need serialization?
What is hashtable in c# with example?
What is boolean method?
What are the two uses of a ‘using’ statement in c#?
Why do we need constructor?