Showing posts with label Pattern. Show all posts
Showing posts with label Pattern. Show all posts

Wednesday, June 29, 2022

Pattern

 Pattern

Problem Statement
Given an integer N, you have to print the given below pattern for N >= 3.

Pattern for N = 4:-
*
*^*
*^^*
*****

static void Pattern(int N){
//Enter your code here
System.out.println("*");
for (int i=0;i<N-2;i++)
{
    System.out.print("*");
    for(int j=0;j<=i;j++)
    {
        System.out.print("^");

    } System.out.println("*");
}
for(int k=0;k<=N;k++)
{
    System.out.print("*");
}

}

ads vert

Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody

  Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody < table >      < thead >    ...