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 / anandraj
class Program
{
void add()
{
int x = 10, y = 20,sum;
fun(x,y,out sum);//changing the parameters
Console.WriteLine("{0}", sum);
}
void fun(int x,int y,out int sum)//changing the
parameter and using out keyword
{
sum = x + y;
}
static void Main(string[] args)
{
Program f = new Program();
f.add();
}
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is array class in c#?
Does a loop recorder have to be removed?
How long has c# been around?
What is a multicast delegate in c#?
What is strong data type in c#?
What is a sealed class?
What is the purpose of dependency injection?
What is difference between singleordefault and firstordefault?
Can you see a loop recorder?
What do u mean by delegation?
What does immutable mean in c#?
What is dll in c#?
What are concrete classes?
HOW to Develope the CRUD(create,read,update,delete) FORM IN WINDOWS form by using c# only
What is the base class for array types?