• Write a Java program to display following pattern on the screen. I IN IND INDI INDIA
Answers
Answered by
0
Answer:
var a = prompt("Enter a string","India").toUpperCase(),n = "";
for (i = 0; i < a.length+1; i++) n+=a.slice(0,i)+"\n";
alert(n);
Answered by
0
Answer:
The following pattern :
I
IN
IND
INDI
INDIA
can be printed as follows :
class pattern_print
{
public static void main(String args[])
{
System .out. println("I");
System .out. println("IN");
System .out. println("IND");
System .out. println("INDI");
System .out. println("INDIA");
}
}
#SPJ3
Similar questions