My Blog
Articles related to programming, computer science, technology and research.

Java program to find a given number is an Armstrong number or not

18/10/2016 Categories: Basic. No Comments on Java program to find a given number is an Armstrong number or not

Armstrong number is one in which the sum of the cubes of individual digits is same as the given number. For example if you take the number 153, (1^3) + (5^3) + (3^3) = 153. Following program reads a number from the user and finds out whether it is an Armstrong number or not: import […]

Read the rest of this entry »

Java program to find a given number is palindrome or not

18/10/2016 Categories: Basic. No Comments on Java program to find a given number is palindrome or not

A palindrome is one which is same after reversing it. For example, if you take a number like 1221, after reversing it, it is again 1221. Following program reads a number from the user and finds out whether it is a palindrome or not:

  Input and output for the above program are as […]

Read the rest of this entry »

Java program to find the reverse of a given number

18/10/2016 Categories: Basic. No Comments on Java program to find the reverse of a given number

Following program reads a number from the user and prints the reverse of that number:

  Input and output for the above program are as follows:

 

Read the rest of this entry »

Java program to find the factorial of a number using recursion

18/10/2016 Categories: Basic. No Comments on Java program to find the factorial of a number using recursion

Following program reads a number form the user and prints its factorial using recursion:

  Input and output for the above program are as follows:

 

Read the rest of this entry »

Java program to find if the given character is a vowel or not

17/10/2016 Categories: Basic. No Comments on Java program to find if the given character is a vowel or not

Following program reads a character from the user and prints out whether it is a vowel or not:

  Input and output for the above program are as follows:

 

Read the rest of this entry »

Java program to print even numbers in the range 1 to n

17/10/2016 Categories: Basic. No Comments on Java program to print even numbers in the range 1 to n

Following program reads n value from the user and prints even numbers in the range 1 to n:

  Input and output for the above program are as follows:

 

Read the rest of this entry »

Java program to print odd numbers in the range 1 to n

17/10/2016 Categories: Basic. No Comments on Java program to print odd numbers in the range 1 to n

Following program reads n value from the user and prints the odd numbers in the range 1 to n:

  Input and output for the above program is as follows:

 

Read the rest of this entry »

Java program to find the sum of first n natural numbers

17/10/2016 Categories: Basic. No Comments on Java program to find the sum of first n natural numbers

Following program reads a number n from the user and displays the sum of first n natural numbers:

  Input and output for the above program is as follows:

 

Read the rest of this entry »

Java program to calculate the sum of digits in a given number

17/10/2016 Categories: Basic. No Comments on Java program to calculate the sum of digits in a given number

Following program reads a number from the user and prints out the sum of individual digits in the given number. For example, if the given number is 1234, program prints 10 (1+2+3+4). Program is as follows:

  Input and output for the above program is as follows:

 

Read the rest of this entry »

Java program to print Fibonacci series up to n terms

17/10/2016 Categories: Basic. No Comments on Java program to print Fibonacci series up to n terms

Following program accepts the number of terms to display in the Fibonacci series and prints it:

  Input and output for the above program is as follows:

 

Read the rest of this entry »
Scroll Up