Math, asked by senguptaanshul, 2 months ago

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 IIAKASHII
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