Computer Science, asked by gargsoham2134, 2 months ago

1.wap in java to input "hello world!"
and print it like this:
h
e
L
L
o

w
o
r
L
d
!
2.reverce the above one.
2 program ​

Answers

Answered by bhattak9617
0

import java. util.*;

class akb

{

public static void main(String args [])

{

Scanner SC = new Scanner(System.in);

System.out.println("Enter your sentence");

String s = SC.nextLine();

for(int i = 0;i<s.length();i++)

{

char ch = s. charAt(i);

if(ch =='l')

ch=Character.toUpperCase(ch) ;

System.out.println(ch) ;

}

}

}

Similar questions