Write a program to print the pattern:
I
IC
ICS
ICSE
Answers
Answer:
import java.util.Scanner;
public class Pattern
{
public static void wordPattern( )
{
int i, j, k = 0 ;
char ch ;
String word = "ICSE" ;
int n = word.length( ) ;
for( i = 0 ; i < n ; i++ )
{
k = 0 ;
for( j = 0 ; j < = i ; j++)
{
k++ ;
System.out.print(ch) ;
}
System.out.println( ) ;
}
}
}
Java:
Java is a popular third-generation programming language, which can be used to do any of the thousands of things that a computer software can do. With the features it offers, Java has become the language of choice for internet and intranet applications. Java plays an important role for the proper functioning of many software-based devices attached to the network.
public class Pattern
{
public static void main( )
String st="ICSE";
for(int i=0;i<st.length( );i++)
{
for(int j=0;j<=i;j++)
{
System.out.print(st.charAt(j));
}
System.out.println( );
}
}
}