public class addition {
public static void main(String[] args) {
// declare variables
int x, y, z;
// Specify values of x and y
x = 2;
y = 3;
z = x + y;
System.out.println("x has a value of " + x);
System.out.println("y has a value of " + y);
System.out.println("The sum of x + y is " + z);
// System.exit(0);
}
}
Tuesday, 23 January 2018
Related Posts:
throw exception in java import java.io.*; //include Java's standard Input and Output routinesc… Read More
Code with problem in javaimport javax.swing.JOptionPane;import java.util.Scanner;public class C… Read More
java swing import java.awt.*;import java.awt.event.*;import javax.swing.*;import … Read More
Get input from user in java import java.io.*;import java.util.Scanner;public class GetUserInput {&… Read More
0 comments: