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
Why should data anaylst should learn about computer arichtecture.
torisob [31]
The knowledge serves as good foundation for me to understand how technology works behind the scene as well. So I must say a good understanding of computer architecture gives the data scientist the ability to propose feasible solution in capturing and maintaining data, implementing models and algorithms in IT systems.
8 0
3 years ago
The number 1 represent what state in binary code
love history [14]
True, is the state of a binary 1
6 0
3 years ago
What happens when your computer is in hibernate mode??
Alina [70]
I think hibernate is sort of like sleep mode. It puts your computer on low battery, but it's not turn off. And some unsaved information doesn't get erase.
6 0
3 years ago
Read 2 more answers
What is the software that finds websites, webpages, images, and other information called?search applicationsubject directorysubj
san4es73 [151]
It is called a search application
7 0
4 years ago
Read 2 more answers
What is a feature of readable code?
mamaluj [8]

Answer:

sorry for the wait but the answer is b

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Declare k, d, and s so that they can store an integer, a real number, and a small word (under 10 characters). Use these variable
    13·1 answer
  • Arcade games such as Donkey Kong, Mr. Dol, and Venture were adapted from arcade titles to home consoles by which company?
    9·2 answers
  • which of the following can be considered a manual control switch a toggle switch a safety switch a drum switch or all of the abo
    9·1 answer
  • There are n coins, each showing either heads or tails. We would like all the coins to show the same face. What is the minimum nu
    6·1 answer
  • A television advertisement claiming that a product is "light-years ahead of its time" does not make sense because (a) it doesn’t
    10·1 answer
  • What is the quickest way to change the format of a table?
    8·1 answer
  • What are three metrics used to define consistent network application availability?
    5·1 answer
  • Which options can be adjusted in the print settings?
    8·2 answers
  • Haya would like to complemely delete Slide 11 from her presentation so that slides 12–16 become slides 11-15. What is
    9·1 answer
  • Time management is the ability to use time effectively.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!