Skip to content

#telusko#navinreddy#10dayschallenge  #4191

@antivirustoai

Description

@antivirustoai

What would you like to share?

public class Pascalstriangle {
public static void main(String[] args) {
int numRows = 5;
int i,j;
for(i=0;i<numRows;i++)
{
for(j=0;j<=i;j++)
{
System.out.print(pascal(i,j) + " ");
}
System.out.println();
}
}
public static int pascal(int row, int col)
{
if(col==0||col==row)
{
return 1;
}
else
{
return pascal(row-1,col-1)+pascal(row-1,col);
}
}
}

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting triageAwaiting triage from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions