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?

Write a program to read in a positive integer, Write a program to read in a...

Write a program to read in a positive integer and check whether it is prime or not? /* Program to check whether a given number is prime or not*/] # include # include

Illustrate about the word processors with its design, Illustrate about the ...

Illustrate about the Word processors with its design Word processors now have many aspects over and above the original task of generating a typed document. This section would

What is organizational structure, What is Organizational Structure? A b...

What is Organizational Structure? A business organization may be structured in many dissimilar ways, depending upon the environment within which it handles.  There is always

What about page footer, By default, this page is quite barren. Though, go e...

By default, this page is quite barren. Though, go explore the Query Page some more; you will search that you can store numerous queries on the server, so if you regularly run a cer

Digital Design, Design a serial 2’s complementer with a shift register and ...

Design a serial 2’s complementer with a shift register and a flip-flop

Remote-load latency problem, Remote-load Latency Problem:  When one process...

Remote-load Latency Problem:  When one processor requires some remote loading of data by other nodes, then the processor need to wait for these two remote load operations. The long

The statement vline is used to insert vertical lines, Like ULINE the statem...

Like ULINE the statement VLINE is used to insert vertical lines. No , Vline is not used to insert vertical lines.

Explain the matlab working environment, This is the set of tools and facili...

This is the set of tools and facilities that you work with as the MATLAB user or programmer. It contains facilities for managing the variables in your workspace and importing and e

Binary resolution - artificial intelligence, Binary Resolution: We look...

Binary Resolution: We looked at unit resolution (a propositional inference law) in the last lecture: A ∨ B,   ¬B /A We may have this a bit further to propositional bin

Give brief description about arithmetic processing unit, Give brief descrip...

Give brief description about arithmetic processing unit To execute the arithmetic operations there is a separate section known as arithmetic processing unit in CPU. The arithme

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