in Education by
Wap in Java to print a pascal triangle in simple language. Please explain the logic Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
import java.util.Scanner; public class JavaPascalTriangle { public static void main(String args[]) { int r, i, k, number=1, j; Scanner scan = new Scanner(System.in); System.out.print(“Enter Number of Rows : “); r = scan.nextInt(); for(i=0;ii; k–) { System.out.print(” “); } number = 1; for(j=0;j<=i;j++) { System.out.print(number+ ” “); number = number * (i – j) / (j + 1); } System.out.println(); } } }

Related questions

0 votes
    WAP in java to input 3 numbers from user and print the largest no. among them using nested if. Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    WAP in java to input 2 numbers from user and print their difference (Always Positive). Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    write a java program to print areaof an equilateral triangle . (without using scanner) Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Is Pascal a computer language named after the inventor of the computer Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    convert the following into For loop; while(true) System.out.print(‘*’); (in java ) PLEASE ANSWER FAST… WILL MARK BRAINLIEST** Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    WAP to print the result based on the user's choice; Choices: 1. Enter 1 to print the Square root of any ... answer fast it's urgent Select the correct answer from above options...
asked Dec 30, 2021 in Education by JackTerrance
0 votes
    WAP in java to check whether the sum of second and third digit of a 4 digit no. , is even or odd? Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    can someone please explain me “this” keyword in java in brief and its use Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    can someone please explain me “this” function in brief in java and its use Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    ANSWER PLEASE What are parameters and types of parameters in programming language ? Select the correct answer from above options...
asked Dec 9, 2021 in Education by JackTerrance
0 votes
    ANSWER PLEASE What are parameters and types of parameters in programming language ? Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    ANSWER PLEASE What are parameters and types of parameters in programming language ? Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    Write a program in Java to find the area and perimeter of a right- angled triangle by using function ... inputs. angled triangle Select the correct answer from above options...
asked Dec 7, 2021 in Education by JackTerrance
0 votes
    Write a program in Java to find the area and perimeter of a right- angled triangle by using function ... inputs. angled triangle Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    Write a program in Java to find the area and perimeter of a right- angled triangle by using function ... inputs. angled triangle Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
...