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
Need help with 4.7 lesson practice
OverLord2011 [107]

Answer:

1.a

2.sorry cant read it that wekk

3.c

Explanation:

7 0
2 years ago
When formulating a linear programming model on a spreadsheet, the decisions to be made are located in the data cells.
Alinara [238K]
True. Gotta have 20 characters to answer
8 0
1 year ago
Let's consider a long, quiet country road with houses scattered very sparsely along it. (We can picture the road as a long line
Rus_ich [418]

Answer:

Follows are the solution to these question:

Explanation:

A simple gullible algorithm is present. Let h mark the house to the left. Then we put a base station about 4 kilometers to the right. Now delete and repeat all the houses protected by this base station. In this algorithm, they can simply be seen to position baselines at b1, . . , bk as well as other algorithms (which may be an optimum algorithm) at b'_{1}, \ . . . . . . ,b'_{k'}  and so on. (from left to right)   b_1 \geq b'_{1},\ \  b_2 \geq b'_{2} That's why k \leq k'.

7 0
2 years ago
Which tool did Adnan use to modify the image?
artcher [175]

Answer:

D

Explanation:

4 0
3 years ago
Read 2 more answers
What is returned by the code: range (20, 100, 30) ?
Hunter-Best [27]
Answer : (20, 50, 80)





4 0
2 years ago
Other questions:
  • A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce. Which statement can a developer use to retrieve
    5·1 answer
  • The this reference . a) can be used implicitly b) must be used implicitly c) must not be used implicitly d) must not be used 25)
    11·1 answer
  • How many seconds are required to make a left turn and join traffic?​
    11·2 answers
  • Taking away iPad privileges when a student hits another child would be considered a(an) ________ principle for decreasing or ext
    10·1 answer
  • A bakery collects data on sales. Each sales record includes the date of the sale and some metadata about the items that were par
    11·1 answer
  • The amount of time taken by each of 10 students in a class to complete an exam is an example of what type of data? a. Cannot be
    15·1 answer
  • having your online class there's a lot of hazards and risk you may encounter while using gadget PC or Laptop whar do you usually
    14·1 answer
  • Es la actividad que posibilita comunicar gráficamente ideas, hechos y valores procesados y sintetizados en términos de forma y c
    11·1 answer
  • How do I create a powershell script to make a Windows user account that is a non-admin user
    7·1 answer
  • Do OBS mic filters apply everywhere? Such as discord and other apps similar. Or is it just on streaming?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!