-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExer03.java
More file actions
40 lines (24 loc) · 778 Bytes
/
Exer03.java
File metadata and controls
40 lines (24 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.laiane.cursojava.aula19;
import java.util.Scanner;
public class Exer03 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int[] vetorA = new int[15];
int[] vetorB = new int[vetorA.length];
for (int i=0; i<vetorA.length; i++){
System.out.println("Entre com o valor da posição: " + i);
vetorA[i] = scan.nextInt();
vetorB[i] = vetorA[i] * vetorA[i];
System.out.println("Vetor A = ");
for (int i1=0; i1<vetorA.length; i1++){
System.out.println(vetorA[i1] + "");
}
System.out.println();
System.out.println("Vetor B = ");
for (int i1=0; i1<vetorB.length; i1++){
System.out.println(vetorB[i1] + " ");
}
System.out.println();
}
}
}