0% found this document useful (0 votes)
5 views1 page

Method Overloading C#

Uploaded by

Madhuri Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Method Overloading C#

Uploaded by

Madhuri Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace METHOD_OVERLOADING
{
class Program
{

//public void Add()


//{
// int a = 20;
// int b = 30;
// int c = a + b;
// Console.WriteLine(c);
//}
public void Add(int a, int b)
{
int c = a + b;
Console.WriteLine(c);
}
public int Add(int a, int b)
{
int c = a + b;
return c;
}

//public void Add(string a, string b)


//{
// string c = a + " " + b;
// Console.WriteLine(c);
//}
//public void Add(float a, float b)
//{
// float c = a + b;
// Console.WriteLine(c);
//}

static void Main(string[] args)


{
Program p = new Program();
//p.Add();
// p.Add(2.5f, 1.5f);
//p.Add(10, 5);
p.Add("Adil", "Mehmood");
Console.ReadLine();
}
}
}

You might also like