Write a program in java to print following.(e.g. BLUEJ)
0 min read
INPUT:-BLUEJ
OUTPUT:- B
L
U
E
J
import java.io.*;
class bluej2
{
public static void main(String args[])throws IOException
{
BufferedReader ob= new BufferedReader(new InputStreamReader(System.in));
int a ;
String str;
char c;
System.out.println("Enter the string ");
str=ob.readLine();
a=str.length();
for(int i=0;i<a;i++)
{
System.out.println(str.charAt(i));
}
}
}
Thanks For Visiting....
MORE PROGRAMS-----
OUTPUT:- B
L
U
E
J
import java.io.*;
class bluej2
{
public static void main(String args[])throws IOException
{
BufferedReader ob= new BufferedReader(new InputStreamReader(System.in));
int a ;
String str;
char c;
System.out.println("Enter the string ");
str=ob.readLine();
a=str.length();
for(int i=0;i<a;i++)
{
System.out.println(str.charAt(i));
}
}
}
Thanks For Visiting....
MORE PROGRAMS-----
Post a Comment