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
A print server uses a print ________ as a software holding area for jobs waiting to be printed.
vichka [17]

Answer:

spooler

Explanation:

A print server uses a print spooler as a software holding area for jobs waiting to be printed.

8 0
3 years ago
Read 2 more answers
Which option allows you to link to a specific slide in another presentation?
tresset_1 [31]
The power-point option for new slide. or maybe duplicate slide.
3 0
4 years ago
Most job applications are online. true or false
Sonja [21]

Answer:

True

Explanation:

4 0
3 years ago
PLEASE HELP ME
alexira [117]

Answer:

it won't be able to run

Explanation:

because computer runs on physical memory

5 0
2 years ago
At each layer of the OSI model, data is appended to the original message and then sent on to the next lower layer. What is this
Makovka662 [10]

Answer:

Encapsulation

Explanation:

There are seven layers in the OSI network model. These layers are, application, presentation, session, transport, network, data-link and physical layer.

Each layer of the OSI model has a PDU or protocol data unit. These PDUs are form by encapsulation.

The application, presentation and session data. When it moves to the transport layer, it is encapsulated within the transport header. This new pdu is called segment.

This process continues in network and data-link to give packet and frame PDUs respectively.

5 0
3 years ago
Other questions:
  • The mouse and keyboard are also sometimes called
    5·1 answer
  • The analysts at Techno Info Systems are considering the four-model approach to system development for a new client. If they make
    12·1 answer
  • What is the purpose of ergonomics in the workplace? A.Keep workers safe and injury free
    5·2 answers
  • Write a Bare Bones program that takes as input a value for X and places 4 times the value of X into the value of Z. The value of
    10·1 answer
  • Which statement describes part of the meeting scheduling process? It is always an all-day event. It is created in a single calen
    14·1 answer
  • What integer is represented by the following 8-bit twos complement representation: 1011 0000 ? (Enter your number in decimal, an
    6·1 answer
  • An option already selected by windows is called____ ( default option/ default selection)​.
    6·1 answer
  • 1.what is a computer?
    5·1 answer
  • Which html tag designates links to other web pages?.
    15·1 answer
  • What was the name of the first computer, developed by charles babbage?.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!