Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Java program to add two numbers

Categories: Basic. 2 Comments on Java program to add two numbers

In this article we will learn to implement a Java program to add two numbers. A java program is provided below which reads two numbers from the user and displays their sum.   Program is as follows: import java.util.Scanner; public class Driver { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter […]

Read the rest of this entry »

Java program to print the nth element in the Fibonacci series

Categories: Basic. No Comments on Java program to print the nth element in the Fibonacci series

In this article we will learn to implement a Java program to print the nth element in the Fibonacci series. A Java program is provided below to print the nth element in the Fibonacci series using both non-recursive and recursive methods.   Program is as follows: import java.util.*; class Fibonnaci { int nFib(int n) { […]

Read the rest of this entry »