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 it good to use var in c#?

816


What is the difference between CreateObject() and GetObject()?

1039


What is string in c# net?

877


How are methods overloaded?

956


What is the difference between array and list in c#?

951


What is icollection in c#?

867


What is different between Static Constructor and Private Constructor?

928


Explain the accessibility modifier protected internal?

810


What is an extension method in c#?

945


how to insert the data from the grid view to database table though button click.pls send the answer to mail id suri1319@gmail.com

1876


Does main have to be static c#?

1014


What is method in c#?

838


Can we overload the main method in c#?

883


What is value c#?

793


Explain the steps to create satellite assembly?

853