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

What is form feed and carriage return?

850


What is the difference between static class and abstract class in c#?

865


What are the different types of assemblies available and their purpose?

862


What is called method in c#?

897


Differentiate between the public and private ?

916


How to use nullable types in .net?

936


Which is faster hashtable or dictionary?

908


What are the types in c#?

846


What are logical operators in c#?

887


Is string a data type in c#?

795


Can we override static class in c#?

848


How to add controls dynamically to the form using c#.net.

846


What is icomparer in c#?

883


What is form feed in c#?

906


Explain About Iunknown interface Queue

914