1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
olga55 [171]
2 years ago
14

Write a program in c++ to displaypascal’s triangle?

Computers and Technology
1 answer:
Harman [31]2 years ago
7 0

<u> C++ Program to Print Pascal's Triangle</u>

 #include<iostream> //header file

using namespace std;

//driver function  

int main()

{

   int r;/*declaring r for Number of rows*/

   cout << "Enter the number of rows : ";

   cin >> r;

   cout << endl;

 

   for (int a = 0; a < r; a++)

   {

       int value = 1;

       for (int b = 1; b < (r - a); b++) /*Printing the indentation space*/

       {

           cout << "   ";

       }

       for (int c = 0; c <= a; c++) /*Finding value of binomial coefficient*/

       {

           cout << "      " << value;

           value = value * (a - c) / (c + 1);

       }

       cout << endl << endl;

   }

   cout << endl;

   return 0;

}

<u>Output</u>

<u>Enter the number of rows :  5</u>

                 1

              1      1

           1      2      1

        1      3      3      1

     1      4      6      4      1

You might be interested in
LAB: Formatted output: Hello World! Write a program that outputs "Hello World!" For ALL labs, end with newline (unless otherwise
maxonik [38]

Answer:

public class LabProgram {

  public static void main(String[] args) {

     System.out.println("Hello World!");    }  }

Explanation:

In this statement: System.out.println

System is a class in JAVA language package

out is a member of class System

println() is a functionT to print or display message to a console or file

So the message to print here is Hello World!

Now this statement   System.out.println prints the message "Hello World!" passed in the argument.

Hence this statement as a whole displays the message Hello World! on the output screen.

6 0
3 years ago
Pls answer 10 points ​
AlekseyPX

Answer:

1. C

5.b

Explanation:

1. Is c because it is in the short cut key

5. Is B because it is the last choice

3 0
2 years ago
Read 2 more answers
It is possible to collaborate on a presentation with a group of people using the Internet.
DerKrebs [107]

Answer:

True

Explanation:

4 0
3 years ago
4. This is considered to be short term memory because it only holds programs
9966 [12]

Answer:

RAM

Explanation:

RAM or Random Access Memory only holds programs which are currently running

8 0
3 years ago
____ gets its name from the notion that it ignores the traditional A, B, and C class designations for IP addresses and can there
Sedbober [7]

<u>Classless Inter-Domain Routing</u> gets its name from the notion that it ignores the traditional A, B, and C class designations for IP addresses and can therefore set the network-host ID boundary wherever it wants to, in a way that simplifies routing across the resulting IP address spaces.

<u>Explanation</u>:

A router is a networking device that helps in connecting multiple networks. <em><u>Classless Inter-Domain Routing (CIDR) </u></em>is used for creating IP addresses and IP routing. CIDR was introduced in the year 1993 by <em><u>“The Internet Engineering Task Force”</u></em>. The classful network design was replaced by CIDR in the Internet.

The IP addresses are responsible for sending the particular information packets to specific computers. Classless inter-domain routing helps in improving the allocation of IP addresses.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose the program counter (pc) is set to 0x2000 0000. is it possible to use the jump (j) mips assembly instruction to set the
    15·1 answer
  • Enhancing and optimizing customer retention and loyalty is a major business strategy.
    15·1 answer
  • You are a disgruntled employee with a master’s degree in computer sciences who was recently laid off from a major technology com
    11·1 answer
  • An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation
    9·1 answer
  • 12. Kelly would like to know the average bonus multiplier for the employees. In cell C11, create a formula using the AVERAGE fun
    7·1 answer
  • Technician A says that the first step in the diagnostic process is to verify the problem (concern). Technician B says that the s
    11·1 answer
  • Questiul 2
    10·1 answer
  • What are they ethical issues with Drones?
    8·1 answer
  • When C++ is working with an operator, it strives to convert operands to the same type. This is known as
    13·1 answer
  • Which subscription service complements App-ID by enabling you to configure the next-generation firewall to identify and control
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!