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
Course Name Grade to Date Progress Overdue Activities
crimeas [40]

lol

i understand hi

hi hi

3 0
3 years ago
Choose the correct statement:_______.
olga2289 [7]

Answer:

d. A String is a class data type so a String variable holds a reference to a location in memory

It depends on which programing language or scripting language...

Explanation:

If it's Java then D is the correct answer...

6 0
3 years ago
Three of the following values could be stored as strings. When would you NOT use a
kifflom [539]

Answer:

To store decimal values

Explanation:

If values are not to be used for calculation, that is, they are not numerical data, therefore, some of them could be stored as strings. A string may contain any sequence of characters. The characters in a string may be repeated.

From the foregoing, decimals can not be stored as strings because in computer programming, a string is normally a sequence of characters, hence the answer above.

5 0
3 years ago
You wish to lift a 12,000 lb stone by a vertical distance of 15 ft. Unfortunately, you can only generate a maximum pushing force
miss Akunina [59]

Answer:

Full question?

Explanation:

Sorry for asking this but where's what you want answered?

8 0
3 years ago
A firewall can consist of all devices positioned on the network _____________.
ale4655 [162]

Answer:

The answer to this question is "perimeter".

Explanation:

In computer science, the firewall is used to provide a network security system that manages network traffic like incoming and outgoing signals. This traffics is based on predetermined security rules. The firewall typically installs a boundary between a trusted inner network and an untrusted outer network, such as the Internet. It is a software concept and Perimeter firewalls manage the flow of network traffic and host or organization's border the boundary that provides the first line of security against outer attacks and blocking access to inappropriate content from inside an organization.

6 0
4 years ago
Other questions:
  • The bias condition for a transistor to be used as a linear amplifier is called:________.
    14·1 answer
  • What is an incremental backup?
    7·1 answer
  • The feedforward part of the conversation should do all of the following except __________.a.identify the toneb.introduce the pur
    11·1 answer
  • Which of these scenarios depicts unethical workplace practice by an employee?
    7·2 answers
  • What are some of the causes for error 1921 when updating?
    11·2 answers
  • In Microsoft Access, what happens when you save a query once and run it but then add more to the query? What will happen? a)erro
    12·1 answer
  • To display a pop-up form for a control, such as account number in a datasheet create a user interface (UI) macro that is associa
    12·1 answer
  • In an all-integer linear program,
    10·1 answer
  • Any correct answers will be helpful.
    13·1 answer
  • A major hospital uses an agile approach to manage surgery schedules. a large board set up in a common office allows staff to qui
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!