class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the
string");
string str1 = Console.ReadLine();
int s = 0;
foreach (char num in str1)
{
if (num != ' ')
{
if (num > 96
&& num < 124)
{
if (s == 0)
{
Console.Write(Convert.ToChar(num - 32));
s++;
}
else
{
Console.Write(num);
}
}
}
else
{
Console.Write(" ");
s--;
}
}
Console.ReadLine();
}
}
Output:
No comments:
Post a Comment