Computer Science, asked by GoodCharm, 23 hours ago

WAP in java
class 10th
icse


no spam ._. ✔​

Attachments:

Answers

Answered by Sanskar260
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