Computer Science, asked by sammohanbando2004, 9 months ago

Write a program to input a sentence. Convert the sentence into upper case letters. Display the words along with frequency of the words which have at least a pair of consecutive letters. Sample Input: MODEM IS AN ELECTRONIC DEVICE Sample Output: MODEM DEVICE Number of words containing consecutive letters: 2

Answers

Answered by Anonymous
6

Answer:

Java program to capitalize first letter of each word in string

public class StringCapital.

{

public static void main(String[] args)

{

String str = "welcome to candid java program";

StringBuilder result = new StringBuilder(str. length());

String words[] = str. split("\\ ");

for (int i = 0; i < words. length; i++)

Explanation:

Similar questions