using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ASCII2Number
{
class Program
{
static void Main(string[] args)
{
string str;
Console.WriteLine("Enter the String to convert ASCII:\t");
str = Console.ReadLine();
int length=0;
foreach (char obj in str)
{
length++;
}
for (int i = 0; i < length; i++)
{
Console.Write(Convert.ToInt32(str[i])+" ");
}
Console.ReadLine();
}
}
}
Output
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ASCII2Number
{
class Program
{
static void Main(string[] args)
{
string str;
Console.WriteLine("Enter the String to convert ASCII:\t");
str = Console.ReadLine();
int length=0;
foreach (char obj in str)
{
length++;
}
for (int i = 0; i < length; i++)
{
Console.Write(Convert.ToInt32(str[i])+" ");
}
Console.ReadLine();
}
}
}
Output
No comments:
Post a Comment