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
Lady bird [3.3K]
3 years ago
9

Please save the program with the name ‘triangle.c’

Computers and Technology
1 answer:
konstantin123 [22]3 years ago
7 0

Answer:

1. #include <stdio.h>

2. int main()

3. {

4.     int k;

5.     int j;

6.     int i;

7.     int array[7];

8.     array[0] = 1;

9.     for (i = 1; i < 9; ++i)

10.     {

11.        array[i] = array[i-1]*2;

12.        for (j=0; j < i; ++j)

13.        {

14.          printf("%d ",array[j]);

15.        }      

16.        for (k=i-2; k > -1; --k)

17.        {

18.          printf("%d ", array[k]);  

19.        }

20.        printf("\n");      

21.     }  

22.     return 0;

23. }

Explanation:

  • From line 1 to 3 we start the main function
  • From line 4 to 7 we declare the variables that we are going to be using throughout the program including an array of 7 positions
  • On line 8 we initialize the array with one to match the sequence
  • From line 9 to 10 we create a for loop to create the 9 sequences of numbers
  • On line 11 we assign values to the array by taking the previous value and multiplying it by 2, this way we can create the sequence 1,2,4,8,32...
  • From line 12 to 15 we print the ordered array
  • From line 16 to 19 we print the inverse array minus one  
  • On line 20 we print an enter

You might be interested in
Were Al Zink’s actions that of someone trying to be an invisible Sponsor
AlexFokin [52]
Al Zink actions differentiate him as trying to take an invisible role as a project sponsor. That is, Al Zink does not do his chosen role and accountability as the lead project sponsor. Though, in dissimilar occasions, Al Zink is seen to evade making a serious choice regarding the development of the project. Consequently, as a project sponsor, it is his accountability to deliver clear steps in increasing the project, recover every step of project development and balance the start of the project. 
7 0
3 years ago
The second letter of the Koeppen letter code gives information about:
lukranit [14]

Answer:

a. the precipitation characteristics of the climate subtype.

Explanation:

The second letter in the code represents the detailed seasonality of precipitation, it shows when during the seasons precipitation comes to that climate.

6 0
3 years ago
What is folded card publishing?​
Alexeev081 [22]

Answer:

Folded card This layout type is for creating greeting cards by printing pages on a sheet and then folding the sheet to make the card. If you choose the Folded card layout, then sheet fold options are displayed. Select an option in the list to specify how you will fold your publication

Explanation:

3 0
2 years ago
Read 2 more answers
Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp pt.3
Luda [366]

Answer:

i guess option 1

5 0
2 years ago
What is it called when two or more devices connect together?.
fredd [130]

Answer:

When two or more computers are connected together so they can communicate with one another, they form a network. The largest computer network in the world in the Internet.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Consider the following general code for allowing access to a resource:
    13·1 answer
  • Margins can be modified in the page layout or by using__.
    15·1 answer
  • The Microsoft-NanoServer-Guest-Package installs the drivers necessary for installing Nano Server as a host OS on a physical mach
    15·1 answer
  • Describe how you center text.
    7·2 answers
  • Which application is a digital version of a manual typewriter? A. Database B. Presentation C. Spreadsheet D. Word processor
    8·2 answers
  • What does IDLE stand for
    11·2 answers
  • By limiting the number of times a person can use a type of software before registering as the authorized owner of that software,
    15·1 answer
  • What are the challenges of Cyber Law???? Needed ASAP ​
    5·1 answer
  • Why does Brainly not have a astronomy section. (I'd prefer brainly answer this)
    7·1 answer
  • Show me how to create an argument essayshow me how to create an argument essay ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!