can someone help me print this pattern in java
Attachments:
siddhartharao77:
(i) (or) (ii) - Which one...
Answers
Answered by
2
import java.util.*;
public class Pattern
{
public static void main(String[] args)
{
String name="ICSE";
int n = name.length();
int i,j;
for(i = 0; i<n; i++)
{
for(j = 0; j <= i; j++)
{
System.out.print(name.charAt(j));
}
System.out.println();
}
}
}
Hope this helps!
public class Pattern
{
public static void main(String[] args)
{
String name="ICSE";
int n = name.length();
int i,j;
for(i = 0; i<n; i++)
{
for(j = 0; j <= i; j++)
{
System.out.print(name.charAt(j));
}
System.out.println();
}
}
}
Hope this helps!
Similar questions