Tuesday 18 September 2012

When user enter numeric value ,print out the character values

Hi friend , this question is generally asked from freshers and sometime from experianced professionals.

The question is when user enter numeric value then it print character value .
Here i have explained how to overcome from this problem.
First open a console application in visual studio and give it some name.

Code:

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

namespace printcharacter
{
class Program
{
static void Main(string[] args)
{
  Console.WriteLine("please enter  numeric value");
int str = Convert.ToInt32(Console.ReadLine());
Console.WriteLine((char)(str + 64));

Console.ReadLine();
}
}
}

I hope You will enjoy .

No comments:

Post a Comment

Note: only a member of this blog may post a comment.