Biology, asked by baba6460, 16 hours ago

Write a program in java to display only those words of a string which carries same letter in both the end and also display how many such words found.​

Answers

Answered by 20E010045
2

Answer:

Explanation:

import java.util.Scanner;

public class KboatNameInitials

{

   public static void main(String args[]) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a name of 3 or more words:");

       String str = in.nextLine();

       int len = str.length();

       System.out.print(str.charAt(0) + " ");

       for (int i = 1; i < len; i++) {

           char ch = str.charAt(i);

           if (ch == ' ') {

               char ch2 = str.charAt(i + 1);

               System.out.print(ch2 + " ");

           }

       }

   }

}

Answered by jinnatunnesa2007
3

Answer:

hi Gaurav kkrh

I got my new rank

reply

Similar questions