Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package Com.Penjaringan;

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
int x;
int jumlah = 0;
Scanner input = new Scanner(System.in);

System.out.println("====== SELAMAT DATANG DI PROGRAM ABSOLUTE VALUE ======");
System.out.print("Berapa banyak nilai yang ingin Anda buat -> ");
x = input.nextInt();

int[] array = new int[x];
System.out.println("Silahkan masukan nilai : ");

for(int i = 0; i < x; i++) {
array[i] = input.nextInt();
if(array[i] < 0){
array[i] = array[i] * -1;
}
}
for (int a : array){

jumlah = jumlah + a;
}

System.out.println(jumlah);
}

}
40 changes: 0 additions & 40 deletions Project_1.html

This file was deleted.

67 changes: 0 additions & 67 deletions style.css

This file was deleted.