Computer Science, asked by tokaians, 1 year ago

Write a java program to input a sentence from the user in lower case and capitalize the first and the last character of each word

Answers

Answered by rohan9307803297
0
with scanner
import java.until.*;
class word
{
void input()
{String s,w;
Scanner sc = new scanner (System.in);
System.out.println("enter beta");
String s= sc.next line();
s = s.to lowerCase();
w="";
s=s+' ';
char Ch;
for( i=0;I<s.length;I++)
{
ch= s.charAt(I);
if(CH!=' ')
{
w=w+ch;
}
else
{



tokaians: its not clear
Similar questions