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
inn [45]
2 years ago
11

Write a c program using loops to generate following output.

Computers and Technology
1 answer:
Keith_Richards [23]2 years ago
8 0

Answer:

#include <stdio.h>

int main()

{

for (int n = 12; n > 0; n--) {

 printf("%d x 2 = %d\n", n, n * 2);

}

}

Explanation:

Only one loop.

You might be interested in
What are spreadsheets in a excel workbook called? A. pages B. notepads C.graphs D.worksheets
galina1969 [7]
D. Worksheets
I’m positive this is the correct answer
4 0
3 years ago
More registers appear to be a good thing, in terms of reducing the total number of memory accesses a program might require. Give
gulaghasi [49]

Answer:

Following is given the answer step by step:

Explanation:

First of all we will write a program using MARIE that will support the statement: Sum = (A + B) - (C + D). All the necessary comments are given in front of each statement:

Load    A                   # variable A will be loaded

Add     B                  # B will be added to A

Store   Temp1         # A + B will be stored in Temp1

Load    C                  # C will be loaded in memory

Add     D                 # D will be added to C

Store   Temp2         # C + D will ge stored in Temp2

Load    Temp1         # Temp1 will be loaded in the memory

Subt     Temp2         # Temp2(A + B) get subtracted from Temp1(A - B)

Store    Sum             # (A + B) - (C + D) will get stored in Sum.

We can see from above program that memory is accessed 9 times. While if C + D get executed first than memory accesses will be reduced to 7.

Above same program could be written using an architecture of 4 registers:

  • R1
  • R2
  • R3
  • R4

The program is as follows:

Load   R1 , A     #A  will be loaded into R1

Load   R2 , B    # B will be loaded into R2

Add     R1 , R2    # R2 gets added to R1 and the result is stored in R1 (A + B)

Load   R3 , C      # C loaded into R3

Load   R4 , D     # D loaded into R4

Add    R3 , R4   # Value in R4 gets added into R3 and R3 becomes (C + D)

                          #no memory accesses required for this operation

Subt   R1 , R4     #R4 (C + D) gets subtracted from R1 (A + B)

                         #no memory accesses required for this operation

Store  Sum        # The recent value will be stored into Sum

Here memory is accessed 5 times in total.

<h2>I hope it will help you!</h2>
8 0
3 years ago
Which programming language uses objects?<br> O C++<br> O ALGOL<br> O Pascal<br> O BASIC
AfilCa [17]

Answer:

Both C++ and Pascal uses objects.

5 0
3 years ago
Read 2 more answers
Which internet technology allows businesses to make presentations and share visual aids such as charts and graphs ?
Akimi4 [234]

Web conferencing is an internet technology that allows people in remote locations collaborate in a virtual conference room by making presentations and sharing visual aids.

Let me know if you have any questions.

8 0
3 years ago
Read 2 more answers
Select the correct answer.
ioda

Answer: D

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Prompt the user for an automobile service. Each service type is composed of two strings. Output the user's input. (1 pt) Ex: Ent
    9·1 answer
  • Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Out
    10·1 answer
  • Hot five was the famous band of which musician?
    14·1 answer
  • Are the actions legal or illegal?
    13·1 answer
  • ____ allows you to control how objects enter, move on and exit slides
    13·2 answers
  • Translation of a file into a coded format that occupies less space than the original file is called
    15·1 answer
  • Justin signed a rental agreement for his new condo. How long is his lease? a p e x
    15·1 answer
  • __________ is a very simple form of lossless data compression in which runs of data (that is, sequences in which the same data v
    6·1 answer
  • For BitTorrent, which of the following is true:
    6·1 answer
  • Can someone help me get spotify premium
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!