Question #20210

can we make a function in c# that take parameter as an integer and return char datatype .
is it possible if is possible .plz give me the example of that program so that i knew the syntax...
and also give me the example that return string ....

Expert's answer

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

namespace Functions
{
class Program
{
& static char returnChar(int parameter)
& {
return Convert.ToChar(parameter);
& }

& static string returnString(int parameter)
& {
return parameter.ToString();
& }

& static void Main(string[] args)
& {
int number = 90;
char character = returnChar(number);
string str = returnString(number);

Console.WriteLine(character);
Console.WriteLine(str);
Console.ReadKey();
& }
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS