SOLVE THIS JAVA PROGRAMMING PLEASE
Attachments:
Answers
Answered by
1
import java. util. *;
class pattern
{
String str;
int len;
public void main ()
{
Scanner sc= new Scanner(System.in);
System. out. println(''Enter the string '');
str=sc.nextLine();
len=str.length();
for (int i =len i>=0; i++)
{
System. out. println(str.substring(0,i) );
}
}
}
maihuterimaa:
it is to be done using switch statement
Answered by
0
import java.util.Scanner;
class pat
{
public static void main(String args[])
{
String str=" ";
Scanner sc=new Scanner (System.in);
System.out.println("Enter the string");
str=sc.nextLine( );
for(int i=6; i>=str.length; i--;)
{
System.out.println(str.Substring(0, i-1));
}
}
}.
HOPE ITS HELPS TO U !!!
Please mark this answer brainliest plzzzz!
class pat
{
public static void main(String args[])
{
String str=" ";
Scanner sc=new Scanner (System.in);
System.out.println("Enter the string");
str=sc.nextLine( );
for(int i=6; i>=str.length; i--;)
{
System.out.println(str.Substring(0, i-1));
}
}
}.
HOPE ITS HELPS TO U !!!
Please mark this answer brainliest plzzzz!
Similar questions