what is code for adding two integers in java?, Computer Engineering

Assignment Help:

import java.util.Scanner;
 
class AddNumbers
{
   public static void main(String args[])
   {
      int x, y, z;
      System.out.println("Enter two integers to calculate their sum ");
      Scanner in = new Scanner(System.in);
      x = in.nextInt();
      y = in.nextInt();
      z = x + y;
      System.out.println("Sum of entered integers = "+z);
   }
}


Related Discussions:- what is code for adding two integers in java?

What is the use of ''using'' declaration in c++, A using declaration in C++...

A using declaration in C++ makes it likely to use a name from a namespace without the scope operator.

Minimum total number of shelv, Write a program that finds the minimum total...

Write a program that finds the minimum total number of shelv, C/C++ Programming

Explain working of counters, Q. Explain working of Counters? A counter ...

Q. Explain working of Counters? A counter is a register that goes through a predetermined sequence of states when clock pulse is applied. In principle value of counters is incr

What is multiplicity, What is multiplicity? Multiplicity is applied to ...

What is multiplicity? Multiplicity is applied to attributes for data base application. Multiplicity for an attribute specifies the number of possible value for every instantiat

Multiple valued logics, Multiple valued logics: Multiple valued logics...

Multiple valued logics: Multiple valued logics, where altered types of truth value such as "unknown" are may be allowed. These have some of the particular advantages of fuzzy

General considerations for research -artificial intelligence, General Consi...

General Considerations for Research -artificial intelligence: If we can specify the initial state, the operators or a consumer and the goal check for a search problem, that al

How are the instructions executed and interpreted, Q. How are the instructi...

Q. How are the instructions executed and interpreted? All computers have a Unit which performs arithmetic and logical functions. This Unit is called as Arithmetic and Logic Uni

What are types of applets, There are two different parts of applets. Truste...

There are two different parts of applets. Trusted Applets and Untrusted applets. Trusted Applets are applets with predefined security and Untrusted Applets are applets without any

Define various system, Define various system? Single job system: Only...

Define various system? Single job system: Only one program may be run at a time, and therefore only one person might be work on a machine at one time.  Multi job system:

Arrays of any size, Modify your program so that the line "int numStones = u...

Modify your program so that the line "int numStones = ui.readStones();" in the Game constructor is considered. Depending on the value of numStones read from the user, you should cr

3/11/2013 2:08:04 AM

you need to use the + operator for adding nos in java

ex,

int a=9;

int b=1;

int s=a+b;

System.out.println(s);

the output will be 10

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd