0% found this document useful (0 votes)
35 views1 page

Sentence Reverse - Jaa

The program takes a sentence as input from the user, finds the first space, and converts the substring before and after the space to uppercase separately and prints them.

Uploaded by

AAsfaw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Sentence Reverse - Jaa

The program takes a sentence as input from the user, finds the first space, and converts the substring before and after the space to uppercase separately and prints them.

Uploaded by

AAsfaw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

package counting.

array;
import java.util.Scanner;

public class CountingArray {

public static void main(String[] args) {


System.out.println("enter a given sentence");
int m=0;
Scanner obj=new Scanner(System.in);
String n=obj.nextLine();
int l=n.length();
char f=' ';
for(int i=0;i<l;i++){
if(n.charAt(i)==f)
{ m=i;
break;
}}

System.out.println((n.substring(m+1).toUpperCase())+"
"+n.substring(0,m).toUpperCase());

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy