Political Science, asked by maihuterimaa, 1 year ago

SOLVE THIS JAVA PROGRAMMING PLEASE​

Attachments:

Answers

Answered by Sumanmi
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
maihuterimaa: =_==_==_==_==_=
Sumanmi: which one? I didn't answer any question
maihuterimaa: this one
maihuterimaa: read PROPERLY
Sumanmi: where is the other question then?
maihuterimaa: r u mad
maihuterimaa: this one
Sumanmi: Are baba, for switch case you must need 2 questions, where is the other pattern?By the way, it's not difficult. Just put switch(ch) and after that case 1: and case 2:
maihuterimaa: kk
Answered by anirudhsingh87
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!

anirudhsingh87: .........
maihuterimaa: use of this keyword?
anirudhsingh87: ye toh theory mai aata hai tunjhe toh aata ho ga
maihuterimaa: (^^)
maihuterimaa: ........
maihuterimaa: ek hi POINT
anirudhsingh87: Keyword 'THIS' in Java is a reference variable that refers to the current object.
anirudhsingh87: hmmmmmmm
maihuterimaa: pta h
anirudhsingh87: okkk ji
Similar questions