Share on Google+Share on Google+

chaitanya
add number
1 Answer(s)      7 years ago
Posted in : Java Beginners

Ads

View Answers

October 24, 2009 at 11:43 AM


Hi Friend,

Try the following code:

import java.util.*;
class Add{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.println("Enter first number");
int a=input.nextInt();
System.out.println("Enter second number");
int b=input.nextInt();
System.out.println("Enter third number");
int c=input.nextInt();
int sum=a+b+c;
System.out.println("Addition of three numbers= "+sum);
}


}

Thanks









Related Tutorials/Questions & Answers:
add number - Java Beginners
add number  Q. write a programe to add three number. The number input... java.util.*; class Add{ public static void main(String[]args){ Scanner input=new Scanner(System.in); System.out.println("Enter first number"); int
Mysql Add Column Number
Mysql Add Column Number       Mysql Add Column Number is used to add the column to the existing table... add Class number(10); Stu table Id Name
Advertisements
Add two number in java
Add two number in java In this section you will learn about how to add two number in java. In java adding two number,  first taking the input provided..."); System.out.println("Please Enter two number to add :"); Scanner sin=new
add
How to add two numbers in Java  add two number   Here... first number: "); int num1=input.nextInt(); System.out.print("Enter second number: "); int num2=input.nextInt(); int sum=num1
add
add two no in Java  Java Add Example that accepts two integer from... Scanner(System.in); System.out.print("Enter first number: "); int num1=input.nextInt(); System.out.print("Enter second number
add
How to add two int numbers in Java Example  How to add two int...(System.in); System.out.print("Enter first number: "); int num1=input.nextInt(); System.out.print("Enter second number: "); int num2
add
Java Example to add two numbers  Java Example to add two numbers ...); System.out.print("Enter first number: "); int num1=input.nextInt(); System.out.print("Enter second number: "); int num2=input.nextInt
add
Java Program to add two numbers  Java Program to add two numbers ...); System.out.print("Enter first number: "); int num1=input.nextInt(); System.out.print("Enter second number: "); int num2=input.nextInt
add
("Enter first number: "); int num1=input.nextInt(); System.out.print("Enter second number: "); int num2=input.nextInt(); int sum
JavaScript Add Element to Array
JavaScript Add Element to Array   ... object and then added the elements to it by providing index number to the object. This number starts from Zero (0) because whenever we assign any value to array
Add Employee
Add Employee  coding for adding an employee
add to cart
add to cart  sir, i want to do add to cart to my shopping application each user using sessions. Plz help thnaks in advance
buzz number
buzz number  buzz number
prime number
prime number  get one number and check the number prime or not using if statement   Java Check Prime Number
prime number
prime number  check prime number using if statement   Java Check Prime Number
Number in array
Number in array  How to write a program to check the number that we are entered from keyboard is in the given array
prime number
prime number  check prime number using if statement   Java Check Prime Number
the number of parameters
the number of parameters  How do I find out the number of parameters passed into function
How to add
How to add   Hi, I want to make a website which will recommend users books according to the genre selected by them. I am using PHP, JavaScript and mySQL. The problem is that there will me almost more than 100 books
Add a fram
Add a fram  I want to put an image on frame on my GUI(Net Beans).please tell me the way to put this. only for frame.. thanks and regards, Rahul Dubey   Here is an example that displays an image on jframe. import
prime number
prime number  could u pls help me out in finding whether a number is a prime number or not?   import java.util.*; class CheckPrimeNumber { static boolean isPrime(int number){ boolean isPrime=false
prime number
prime number  To check a number entered by user is prime or not?   Java check prime number import java.util.*; class CheckPrimeNumber { static boolean isPrime(int number){ boolean isPrime=false
Armstrong number
Armstrong number  I want java program for Armstrong number
prime number
prime number  To check a number entered by user is prime
prime number
prime number  write a java program for prime number
prime number
prime number  HI!I want a java program that accepts a number from user and displays whether it is a prime number or not using BufferedReader
prime number
prime number  to check wethere given number is prime or not?  ... { static boolean isPrime(int number){ boolean isPrime=false; int i=(int) Math.ceil(Math.sqrt(number)); while (i>1
Count number of "*"
Count number of "*"  I have this code to count the number of * from a string entered. but I need to find it from an text file. Any idea? import...++; } } System.out.println("The number of vowels in the given sentence
Number Pyramid
Number Pyramid  Hi Everyone, Can someone help me write the code for the following number pyramid: print... 0 0 0 0 4 ... "); There is 5 spaces in between each number
Primary number
Primary number  write a program to find the 100th or nth primary number?   import java.util.*; class PrimeNumber{ public static void main(String a[]) { Scanner input=new Scanner(System.in
Primary number
Primary number  write a program to find the 100th or nth primary number?   import java.util.*; class PrimeNumber{ public static void main(String a[]) { Scanner input=new Scanner(System.in
Tutorials   
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads