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

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);

Posted Date: 3/11/2013 2:07:42 AM | Location : United States

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


int a=9;

int b=1;

int s=a+b;


the output will be 10

Posted by | Posted Date: 3/11/2013 2:08:04 AM

Related Discussions:- what is code for adding two integers in java?, Assignment Help, Ask Question on what is code for adding two integers in java?, Get Answer, Expert's Help, what is code for adding two integers in java? Discussions

Write discussion on what is code for adding two integers in java?
Your posts are moderated
Related Questions
Explain about Bus of register transfer Since a computer has   several registers, paths must be provided to transfer information among registors. If separate lines are used amon

what is system programming? System programming is the activity of implementing and designing SPs. System programs that are the standard component of the s/w of most computer

(a) Explain, using suitable examples, the functions of each of the sub system mentioned in the context of a large chain of supermarkets (i) Database Management Subsystem (ii)

What are the risks involved in Electronic Payment Systems?    From the customer's perspective: Dishonest merchants or financial service providers Stolen payment

Q. Feature of micro-instruction execution? Feature of micro-instruction execution is micro-instruction sequencing which involves address calculation of next micro-instruction.

Illustrate about the Problem statement Problem statement would not be incomplete, inconsistent and ambiguous. Try to state the requirements precisely and point to point. Do no

Your logic function for this assignment is to be derived from your own student number. The number 1224583 will be used as an example as to how you should derive your function and e

What is a multitape TM?  A  multi-tape  Turing  machine  having  of  a  finite  control  with  k-tape  heads  and k-tapes each tape is infinite in both directions. On a one mov

Backward Chaining: In generally given that we are only interested in constructing the path whether we can set our initial state to be the theorem statement and search backward

A museum has a collection of old posters advertising events of various kinds (theatre, sport, fairs, lectures etc.). It wishes to keep a record of these, containing, for each poste