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]
3 years ago
14

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

Computers and Technology
1 answer:
Harman [31]3 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
An organization is concerned with the amount of sensor data that is being generated locally, analyzed in the cloud, and returned
Sonja [21]

Answer:

Fog computing

Explanation:

Fog computing or fogging is an decentralized architecture that resides between the cloud and the data source. Fog brings the cloud closer to the data source, that is, it brings resource exploitation, security polices and operational cost closer to the data source.

In our scenario, with fogging in place, the generated sensor data will be preprocessed closer to the local site. The data will preprocessed faster and the quality of the processed data will be greatly increased.

3 0
3 years ago
BRAINLIEST Which function will add a name to a list of baseball players in Python?
Tju [1.3M]

Answer: Append()

Explanation:

8 0
3 years ago
Read 2 more answers
what is created when the movement of light is blocked by an object and cannot pass through the other side?
larisa86 [58]
A shadow is created.
7 0
3 years ago
Read 2 more answers
Gini is a manager at a website design firm. She has a timeline prepared for the product to be delivered to the client. She needs
Grace [21]

Answer:

The correct answer is letter "A": controlling.

Explanation:

There are four (4) basic management skills: <em>Planning, Controlling, Organizing, </em>and <em>Leading.  </em>

Controlling implies reviewing the objectives the firm has established to evaluate the progress. It also involves measuring the resources the firm has available for reaching its goals and verifying if they will be enough to get to the finish line, otherwise, the company should find more efficient forms of allocating resources and funding its operations.

In other words, <em>the controlling skill of management sets the standards of performance within the institution.</em>

7 0
3 years ago
Read 2 more answers
Which one of the following items would you be most likely to keep in a database? A. Payroll records B. Address book C. Financial
True [87]
The item that you would most likely to keep in a database is a Payroll record. Payroll records are numbers and inputs/outputs of employees of a certain company. Numbers are easier to manipulate and easier to manage than statements, letters and addresses that are basically letters.
3 0
3 years ago
Other questions:
  • What is the voltage drop across R4 in the diagram shown above?
    13·1 answer
  • For some reason, Danica's classmate George could not find the registered symbol in the symbol gallery. He is selling
    14·1 answer
  • What is the purpose of the Excel Function Reference?
    9·1 answer
  • Discuss what repetitions structures are, and how they differ from the vectorization approaches we have previously studied in the
    10·1 answer
  • Johnathan was assigned to complete a project with three other people. What benefit will he get from working with the team?
    15·1 answer
  • True/False: On the piano, middle C is located to the left of the 2 black keys in the middle.
    9·2 answers
  • You were recently hired by a small start-up company. The company is in a small office and has several remote employees. You have
    15·1 answer
  • Read the following scenario. How might Sarah correct successfully complete her task?
    6·1 answer
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    13·1 answer
  • If you have created users with administrator privileges on your windows 7 or linux systems, why bother creating other user accou
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!