WAP in java
class 10th
icse
no spam ._. ✔
Attachments:
Answers
Answered by
2
Answer:
(a)
class pattern
{
public static void main(String args[])
{
int c=1;
for(int i=1; i<=5; i++)
{
for(int j=1; j<=i; j++)
{
System.out.print(c+" ");
c++;
}
System.out.println();
}
}
}
(b)
class pattern
{
public static void main(String args[])
{
String s="ICSE";
for(int i=0; i<=s.length()-1; i++)
{
for(int j=0; j<=i; j++)
{
System.out.print(s.charAt(j));
}
System.out.println();
}
}
}
Similar questions
Science,
8 months ago