Question:· 9) Write a program to input: a sentence and print the number of characters found in the smallest word of the given sentence.
For Example:: if S = .. Spicer is 0ne, of the best school In Pune'' then the output should be 2
Answers
Answered by
3
Answer:
public static void Main(string[] args)
{
All 36%
string input = Console.ReadLine();
string splittedwords = input.Split(' ');
int max = 0;
foreach (string word in splittedwords)
{
if (word.Length > max)
{
max = word.Length;
}
}
Console.WriteLine(max);
Similar questions
Science,
1 month ago
English,
2 months ago
Chemistry,
10 months ago
Environmental Sciences,
10 months ago