Computer Science, asked by shreyaghosh1211, 10 months ago

Write a Java Program to assign a sentence and print the first word.​

Answers

Answered by gyankamal2000
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 kaspaprathyusha
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