-
Notifications
You must be signed in to change notification settings - Fork 20.8k
Closed
Labels
awaiting triageAwaiting triage from a maintainerAwaiting triage from a maintainer
Description
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
Labels
awaiting triageAwaiting triage from a maintainerAwaiting triage from a maintainer