Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is cli same as the clr?

909


What is the value which is accepted by all data types ?

999


How do you prevent a method from being overridden in c#?

865


What is an Interface in C#?

984


Describe two uses of the “using” statement during the operation of c#?

965


What are the boolean data types in c#?

1021


Explain the security with aop?

1069


What are the advantages of using partial classes?

1005


Is c# a backend language?

981


How will you deploy the dll file in gac?

948


Can we inherit two classes in c#?

956


Which is faster hashtable or dictionary?

983


What do you understand by 'access specifiers' in C#?

900


What is the difference between select and selectmany?

948


Is string a class in c#?

850