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
astraxan [27]
3 years ago
13

You do not need to use any functions beyond the main function in this problem. Initialize an array of int with the values: 4, 6,

9, and 12. Write a for loop to add the values in the array and find their sum. Write a second loop to print the values from the array and their sum in the following format: 4 + 6 + 9 + 12 = 31
Computers and Technology
1 answer:
Mariulka [41]3 years ago
3 0

Answer:

Following are the code in C language

#include <stdio.h> // header file

int main() // main function

{

int s1=0;// variable declaration

int arr[10]={4,6,9,12}; // array declaration

for(int k=0;k<4;++k) // iterating over the loop

{

s1=s1+arr[k]; // sum of the array of elements  

}

for(int k=0;k<4;++k) // iterating over the loop

{

if(k<3)

{

printf("%d+",arr[k]); //for display values

}

else

{

printf("%d=",arr[k]);

}

}

printf("%d",s1); // display the total sum

return 0;

}

Output:

4+6+9+12=31

Explanation:

  • Declared a variable sum of int type also declare an array "arr" of int type.
  • Iterating over the for loop to add the values of the array in the "sum" variable.
  • Again iterting the for loop  to print the values from the array in the format as given in the question .

You might be interested in
ACTIVITY NO. 5 (DAY 5) FACT OR BLUFF. Write Fact if the statement is correct and write Bluff if it is incorrect.
KengaRu [80]

All of the above are Facts.

preventive maintenance does indeed help with the lifespan etc.

If you are feeling tired or fatigued when operating machinery, stop and rest for fear of mistake. So , two is also correct

4if you dress inappropriately it may cause danger from getting caught in machinery or catching a flame depending on the worksite. so four is correct. Newer models are most likely more updated and have different operations then the last machine. so yes read the manual before using it. so yet again 5 is also correct.

hopefully this helped

3 0
3 years ago
Think of the silliest problem the problem solving process could help with.
arlik [135]

Answer:

if 4 slinkies were put down a set of stairs at different times but reached the bottom at the same time. whats the difference?          

Explanation:

5 0
3 years ago
Read 2 more answers
What happens when a user updates a record after a developer creates a Workflow Rule declaratively that updates a field on an obj
Sindrei [870]

Answer:

d. The trigger is fired more than once.

Explanation:

What would happen in this situation is that the  trigger would be fired more than once. This is because the trigger will be fired when the user updates the record. It will also be fired when the process builder is run.

If the trigger fires more than once, this can be problematic for the developer. Therefore, it is better if the trigger fires just once, as this is the time when the present changes can be placed.

5 0
3 years ago
A _____ model is one that is automatically adjusted based on changing relationships among variables.
BabaBlast [244]

Answer: dynamically modified model

Explanation:

7 0
2 years ago
We use _____command to get data from the user? (python)
Genrish500 [490]

Answer:

INPUT

Explanation:

EXAMPLE PYTHON CODE

_______________________________________________________

INPUT CODE:

_______________________________________________________

foo = input('foo: ')#Have some text printed before the input field

bar = foo

print(bar)

_______________________________________________________

OUTPUT CODE:

_______________________________________________________

foo: Hello World!

Hello World!

>>> bar

'Hello World!'

>>>foo

'Hello World!'

5 0
3 years ago
Other questions:
  • Using the flowchart below, what value when entered for Y will generate a mathematical error and prevent our flowchart from being
    14·1 answer
  • What are examples of educational obstacles to a career plan?
    13·1 answer
  • Who's YouTube creator?
    10·2 answers
  • Who developed the idea of a universal network?
    11·1 answer
  • relational integrity constraints are rules that enforce basic and fundamental information-based constraints. True or False
    9·1 answer
  • Which of the following situations would not require knowledge of networking?
    11·2 answers
  • What is machine learning
    9·2 answers
  • Which of the following is a key difference between a Windows 7 restore point and one you set yourself?
    11·1 answer
  • define the term computer hardware and its various types mentioning 5 examples of IP or devices with one diagram each​
    9·1 answer
  • Due TODAY!!! Can someone please help me!!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!