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 custom date format set for a date/time field that contains the symbols mmm/dd/yy would display the date as ____.
Lena [83]
Format for date is: mm/dd/yy
mm means month
dd means day
and
yy   means year.
Like: mm/dd/yy  12 / 15 / 2017    
December 15, 2017.
5 0
3 years ago
Which of the following is not a type of Internet Job Board? Options Resume Blaster Professional Association Target Applicants We
mr Goodwill [35]
The answer is : Weighted application blanks

Job board is a type of system in which the employers set up a list of requirements for the job hunter

Weighted Application blanks is used to to collect background information from the job applicants, which is not a part of job board
6 0
3 years ago
What does "Forward" in emails do?​
tatuchka [14]
Basically just want to make your your email is easy
4 0
4 years ago
Alejandra is using a flash drive that a friend gave to her to copy some financial records from the company database so she can c
Misha Larkins [42]

Answer:

maybe threat?

Explanation:

4 0
3 years ago
Which path needs to be followed to change the currency settings of Windows Operating System?
PIT_PIT [208]

Answer:

To configure operating system settings, in Control Panel, click Performance And Maintenance. To view operating system performance configuration options, in the Performance And Maintenance window, click System, and then click the Advanced tab.

4 0
3 years ago
Other questions:
  • Alison retrieved data from a company database containing personal information on customers. When she looks at the SSN field, she
    14·1 answer
  • The __________ vulnerability assessment is a process designed to find and document selected vulnerabilities that are likely to b
    15·1 answer
  • "This part of the computer fetches instructions, carries out the operations commanded by the instructions, and produces some out
    15·1 answer
  • 14. Convert 11110111 from binary to denary<br> (1 Point)
    12·2 answers
  • What is the traditional cognitive perspective ofHCL?
    12·1 answer
  • what are the benefits of VolP? select all that apply. A:cheaper printings B:clearer calls C: faster download D: increased effici
    11·2 answers
  • Create a function called is_list_empty that takes a single argument of type list. Your function should return True if the list i
    7·1 answer
  • The terms Apps and Applications can be used interchangeably about software installed
    8·1 answer
  • Please help i only have 20 minuets
    5·1 answer
  • Help me with thissssss
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!