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
Why does Brainly say, "We're sorry, but we are not able to complete your registration at this time?" Please tell me, because I r
Rus_ich [418]

just change your age to 13 or above-

6 0
3 years ago
Have all of my coins because i will delete acount there will be part 2, 3 , 4 ,5,6,7,8
kirza4 [7]
Thank you very much your are awesome
3 0
3 years ago
Read 2 more answers
Core component of the linux operating system is the linux kernel. if you were a linux systems administrator for a company, when
iragen [17]
You would only need to upgrade your kernel via linux if u were a mlg hacker and knoushs how to speakith the englith
5 0
3 years ago
Which is true about TCP and UDP? Choose two answers.
vichka [17]

Answer:

TCP is a connection-oriented protocol

UDP does not acknowledge a receipt of data

Explanation:

TCP (Transmission Control Protocol) is a protocol to transfer data, this is one of the most important protocols on the entire internet, this method was implemented from the beginning of the network.

UDP (User Datagram Protocol) this is a protocol faster than TCP because this method doesn't establish a connection to sent data, in this case, always sent data, but TCP is more secure than UDP, and for that UDP is used to transfer music or videos, and TCP websites and database.

UDP doesn't need acknowledgment is done by UDP, is only concerned with speed.

7 0
4 years ago
Describe a time when you or someone you know conformed to the behavior of others. Why do you think this person chose to conform?
ki77a [65]
Because he was naive and pliable
5 0
3 years ago
Read 2 more answers
Other questions:
  • Pages with obvious problem with functionality or errors in displaying content
    11·1 answer
  • To use the Web, each client computer requires a data link layer software package called a Web browser. True False
    8·1 answer
  • What is the size of the opening in the camera that the light passes through?
    9·2 answers
  • 6. What is the correct way to write 340,000,000 in scientific notation? (1 point
    8·1 answer
  • Which of these scenarios depicts unethical workplace practice by an employee?
    7·2 answers
  • What is an icon?
    6·1 answer
  • Assume that messages sent between two programs can be lost, duplicated, delayed, or delivered out of order. Design a protocol th
    9·1 answer
  • What is blogging
    15·2 answers
  • URGENT!!Motors and gears play an important role in the motion of robots. Discuss the different types of motors used in robotics.
    9·1 answer
  • FIRST TO Answer for free brainlest. GOG GOGOGO
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!