Answer to Question #20210 in C# for ali akhtar

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 ....
1
Expert's answer
2012-12-10T10:45:31-0500
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!

Comments

Assignment Expert
19.12.12, 14:38

You're welcome. We are glad to be helpful. If you really liked our service please press like-button beside answer field. Thank you!

ali akhtar
19.12.12, 08:05

thank u for he help this code helped me...

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS