Write a Java Program to assign a sentence and print the first word.
Answers
Answered by
0
Answer:
import java.util.*; public class First Letter Capital. {
public.
static. void main. (String args[]) ...
System.out.println("Enter the sentence." ); ...
for(int i=0;i<s.length();i++) { ...
if(x==' ') { ...
cap=cap+Character .to UPPERCASE (y); i++; ...
System.out.println("The new String with capital letters is: "+"\n"+cap); }
Answered by
0
Answer:
import java.util.*; public class First Letter Capital. {
public.
static. void main. (String args[]) ...
System.out.println("Enter the sentence." ); ...
for(int i=0;i<s.length();i++) { ...
if(x==' ') { ...
cap=cap+Character .to UPPERCASE (y); i++; ...
System.out.println("The new String with capital letters is: "+"\n"+cap); }
Similar questions