001-005-004
Variable as Value Assignment: Number Copy
Easy
Problem Description
variable as Value Assignment: Number Copy
In this problem, you will create a program that initializes an integer variable, copies its value to another variable, and displays both values to standard output.
Learning Objective: Learn how to copy a variable's value to another variable
Overview
When you assign one variable's value to another, the current value is copied. Let's create a program that copies and displays the original number!
Specifications
- Initialize integer variable
originalto 100 - Assign
original's value to variablecopy - Output both values
Output Format
Original: 100
Copy: 100
Test Cases
※ Output examples follow programming industry standards
Input:
Expected Output:
Original: 100 Copy: 100
Input:
Expected Output:
Original: 100 Copy: 100
Input:
Expected Output:
Original: 100 Copy: 100
Input:
Expected Output:
Original: 100 Copy: 100
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 9 free executions remaining
