C# Program toward Print Entering Characters from users furthermore then Count Total entering characters
Program Statement:
Write a program which takes characters from user until user press ENTER furthermore then program will show the number regarding words with length greater than or equal toward 5.
Solution:
public class length
{
int count1 = 0, count2 = 0;
public void check()
{
Console.Write("\n\t\tEnter string : ");
string ch = Console.ReadLine();
beneficial to (int x = 0; x < ch.Length; x++)
{
if (ch[x] == ' ')
{
count1++;
if (x >= 5)
{ count2++; }
}
}
Console.WriteLine("\n\t\tNumber regarding words with length greater than or equal toward 5 : {0}", count2);
Console.WriteLine();
}
}