Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

ava program to add two numbers taking input from user

import java.util.Scanner;public class Main{public static void main(String[] args){int a, b, sum;Scanner sc = new Scanner(System.in);System.out.println("Enter First Number: ");a = sc.nextInt();System.out.println("Enter Second Number: ");b = sc.nextInt();sc.close();sum = a + b;System.out.println("Sum of these numbers: "+sum);}}
Comment

PREVIOUS NEXT
Code Example
Java :: Static And Public Methods 
Java :: reference to an instance method of an arbitrary object of a particular type 
Java :: java i/o streams 
Java :: x^n+y^n=z^n 
Java :: How do you use both Spring Data JPA and Spring Data Elasticsearch repositories on the same domain class in a Spring Boot application? 
Java :: how do i get DefaultTableModel rows sum in column in java 
Java :: how do you rate yourself in java 
Java :: how to show the hex detail of a file in java 
Java :: Join Two Java Strings 
Java ::         System.out.println("Welcome to GeeksforGeeks"); 
Java :: minecraft bukkit coding player sharing variable 
Java :: adding Executable Jars to Spring Maven Project 
Java :: Java Add elements to a LinkedList 
Java :: Android popBackStack to specific fragment 
Java :: where to check when you hava a error 
Java :: Lists - removing with iterator 
Java :: java declared fields vs fields 
Java :: load list of integers from console 
Java :: java project with submodules 
Java :: at org.apache.spark.sql.errors.QueryCompilationErrors$.failedToFindKafkaDataSourceError(QueryCompilationErrors.scala:1037) 
Java :: java assertions 
Java :: get value from dynamic input android 
Java :: javafx character counter 
Java :: java setting logging with rotation logback 
Java :: android studio clear child views 
Java :: short array in java 
Java :: toSet 
Java :: differance entre appel implcite et explicite en java 
Java :: define 2d array in java 
Java :: math.round java 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =