I
IC
ICS
ICSE
ICS
IC
I
print this series using java.
Anonymous:
are kis liye block ki woh toh batao
Answers
Answered by
7
Class Demo
{
public static void main(String[] args)
{
String s = "ICSE";
for(int i=0;i<4;i++)
{
for(int j=0;j<=i;j++)
System.out.println(s.charAt(j)+" ");
System.out.println();
}
for(int i=4;i>=1;i--)
{
for(int j=1;j<i;j++)
{
System.out.println(s.charAt(j-1)+" ");
}
System.out.println();
}
}
}
Hope this helps!Good Luck.
{
public static void main(String[] args)
{
String s = "ICSE";
for(int i=0;i<4;i++)
{
for(int j=0;j<=i;j++)
System.out.println(s.charAt(j)+" ");
System.out.println();
}
for(int i=4;i>=1;i--)
{
for(int j=1;j<i;j++)
{
System.out.println(s.charAt(j-1)+" ");
}
System.out.println();
}
}
}
Hope this helps!Good Luck.
Answered by
2
Answer:
Class Demo
{
public static void main(String[] args)
{
String s = "ICSE";
for(int i=0;i<4;i++)
{
for(int j=0;j<=i;j++)
System.out.println(s.charAt(j)+" ");
System.out.println();
}
for(int i=4;i>=1;i--)
{
for(int j=1;j<i;j++)
{
System.out.println(s.charAt(j-1)+" ");
}
System.out.println();
}
}
}
Explanation:
Similar questions