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
garri49 [273]
3 years ago
12

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
Computers and Technology
1 answer:
zheka24 [161]3 years ago
4 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    int[] arr = {4, 6, 9, 12};

    int sum = 0;

   

    for(int i=0; i<arr.length; i++){

        sum += arr[i];

    }

   

    for(int i=0; i<arr.length; i++){

        System.out.print(arr[i] + " ");

    }

    System.out.println("");

 System.out.println("The sum of the numbers: " + sum);

}

}

Explanation:

* The code is written in Java.

- Initialize the array with the given numbers

- Initialize the <em>sum</em> variable as zero

- Calculate the sum in the first for loop

- Print the numbers in the second for loop

- Print the <em>sum</em>

You might be interested in
Select all the correct answers.
oksian1 [2.3K]

Answer:

It's probably "facilitate discussions"

Hope this helps you!

Bye!

4 0
3 years ago
Read 2 more answers
How dependent are we on technology? ​
rusak2 [61]

very independent  : ) we use it for everything

3 0
3 years ago
Read 2 more answers
चार फरक छुट्याउनुहोस् ।) 3. Write down any four provisions of cyber ethic साइबर नैतिकताका कुनै चार प्रावधानहरु लेख्नुहोस् ।​
Kruka [31]

Answer:

Five provisions of cyber ethics are:

Your computer or system should not be used to harm others. Your cyber knowledge should not be used to steal other people's resources. One should not use or copy softwares for which you have not paid. ... Never use other people's resources without their consent.

7 0
3 years ago
WILL GIVE BRAINLIEST ANSWER!!!<br><br> How do you manage your screen time?
Aloiza [94]
You can set it up in settings and set strict hours for screen time.
7 0
3 years ago
Read 2 more answers
How do i show all emails from same sender in outlook
OverLord2011 [107]

Your just gonna have to scroll through all of them until you find the right one or search for some key words.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Ooooooooooooooooooooooooooooh im blinded by the lightssssssssss
    11·1 answer
  • The difference between an AutoCorrect entry and a building block is that the building block feature makes corrections automatica
    6·1 answer
  • The process of saving files to disk is called.<br> A.read<br> B. Write<br> C. Lock<br> D. Protect
    6·1 answer
  • Select the correct answer from each drop-down menu. What skills should Tara hone to get a job in testing? Tara is a recent compu
    12·1 answer
  • What is true about investments and risk
    14·1 answer
  • A set of instructions to increase a programmer’s pay rate by 10 percent is hidden inside an authorized program. It changes and u
    12·1 answer
  • 1) a program that is designed to perform only one task.
    11·1 answer
  • Question #1
    9·2 answers
  • PLEASE HELP URGENT!!
    5·2 answers
  • What is a zerø-day exploit? No go.ogle &gt;:(
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!