Posts

Showing posts from 2018

Disarium Number

Disarium Number in JAVA A Disarium Number  is a number if the sum of its digits powered with their respective position is equal with the number itself. Example :   1 1 +3 2 +5 3  = 135 Algorithm and Program Below  :-

Mirror Image of a Matrix

Image
Mirror Image of a Matrix in JAVA Finding  Mirror image of a  matrix  of order  M  X N  is given.  Logic and Program  :-

Evil Number in JAVA

Evil Number An Evil Number is a non-negative integer that has an even number of 1s in its binary expansion . Some evil numbers are:   3, 5 , 6, 9 , 10.  This Program video link is provided at the bottom of this post. Program given Below  :-

Decimal to Binary Number in JAVA

Decimal to Binary Number Example : Input : 13                   Output : 1101   Program given Below  :-

Print Initials of a given Name in JAVA

Initials of a Name in JAVA Example : Input : Mahendra Singh Dhoni                   Output : M.S. Dhoni Algorithm and Program Below  :-

Arranging given Word in Alphabetical Order in JAVA

Arrange the String in Alphabetical Order Example : Input : Computer                   Output : Cemoprtu Algorithm and Program Below  :-

Twisted Prime in JAVA

Twisted Prime Number A number is said to be Twisted Prime if it is a prime number and reverse of the number is also a prime number. Twisted Prime number is also called Emirp Number. Example : Input = 79                   Reverse = 97 Output : Twisted Prime Algorithm and Program Below  :-

Primorial Number in JAVA

Primorial Number Primorial Number is like factorial number. In Primorial Number all the prime numbers upto a given number is Multiplied. Example : Input = 10                   Output = 210 Primorial : 2*3*5*7 Algorithm and Program Below  :-

ROT 13 Program in JAVA

ROT 13 Program in JAVA  ROT 13 means ROTATE 13 . It is an Encryption Scheme which works by cyclic shifting of each Lower Case and Upper Case letter 13 position. Example :-  Input -  Encryption Output - Rapelcgvba

Sort 2-D Array in Java

Image
Sort 2-D Array in Java In this Program we have to SORT a 2-D Matrix in ascending order. Ex - 

Sum of Diagonals of a Matrix

Image
Sum of Diagonals of a Matrix Easiest Program to calculate the sum of LEFT and RIGHT  diagonal of a  Matrix of order ( m x n) where m = n in JAVA. Example :-

Swapping Diagonal elements of a Matrix

Image
Java Program To Swap Diagonal elements of a Matrix A matrix of order N X N  is given. S wap  the  elements  of major and minor   diagonals .  Major  Diagonal Elements  of a  Matrix  are the ones that occur from Top Left of  Matrix  Down To Bottom Right Corner . The Major  Diagonal  is also known as Main  Diagonal   or Primary  Diagonal . Minor Diagonal  Elements of a  Matrix   : The  Minor Diagonal  Elements are the ones that occur from Top Right of  Matrix  Down To Bottom Left Corner . Also known as Secondary  Diagonal . Logic and Program :-

PalPrime Number in JAVA

Image
Palindromic Prime Number in JAVA If a number is simultaneously palindromic and prime then it is said to be a  PalPrime  Number. Example: Number 313, 353 etc are PalPrime  number. Algorithm and Program below :-

Magic Number in JAVA

Magic Number in JAVA A Number is said to be a Magic Number if the sum of its digits are calculated till a single digit is obtained by recursively adding the sum of its digits. If the single digit comes to be 1  then the number is a Magic Number . Example- 199 is a magic number as 1+9+9=19 but 19 is not a sigle digit number so 1+9=10 and then 1+0=1 which is a single digit number and also 1.Hence it is a magic number. PROGRAM below :-

Composite Number in JAVA

Image
Composite Number in JAVA A  Composite Number   is a positive integer that has at least one positive divisor other than one or the  number  itself. Example : 4,6,8 etc are composite number. Algorithm and Program below :-

Neon Number in JAVA

Neon Number in JAVA A Neon Number is a number whose sum of digits of square of the number is equal to the number. Example : Input number is  9 , its square is  9 * 9  =  81  and sum of the digits of square is  9 . i.e.  9  is a neon number Algorithm and Program below :-

SPY Number in JAVA

SPY Number in JAVA A Number is said to be a  SPY  Number if the sum and product of all digits are equal. Example: Number  123  is a Spy number, sum of its digits is  6 Algorithm and Program below :-

Perfect Number in JAVA

Image
Perfect Number in JAVA A  Perfect Number  is a positive integer that is equal to the sum of factors i.e. the sum of its positive factors excluding the  number  itself. Example - Factors of 6 = 1+2+3 = 6 . 6 is a Perfect Number Algorithm and Program below :-

Niven/Harshad Number in JAVA

Niven/Harshad Number in JAVA A positive integer which is divisible by the sum of its digits, also called a  Niven/Harshad number. Example - 81 is divisible by 8+1= 9 . 81 is Niven Number. Algorithm and Program below :-

Pattern Program - 2 in JAVA

Pattern Program - 2 Program to display the following number pattern on screen. Pattern :- 12345 1234 123 12 1 12 123 1234 12345 Algorithm :-

Pattern Program in JAVA

Pattern Program - 1 Program to display the following number pattern on screen. Pattern :- 1 12 123 1234 12345 Program below :-

Program to check a Number is Even or Odd.

Program to check a Number is Even or Odd A number is even if it is divided by 2 leaves no remainder, Otherwise it is an odd number. Example : 16 when divide by 2 leaves no remainder So 16 is even.                  19 when divide by 2 leaves 1 remainder so 19 is odd. Algorithm :-

Quiz Game Program in JAVA for ICSE

Quiz Game Program in JAVA Quiz Program Project in JAVA for ICSE Students :- User is asked to give answers of 40 questions. For every correct answer 1 point is added in the score. At the end Final Score will be displayed. Run program in Bluej for organised and better result. Program below :-

Palindrome Number in JAVA

Palindrome Number in JAVA Program to check a number is Palindrome or not. A Palindrome Number  is a number that remains the same when its digits are reversed. Example : 121 is a palindrome number. Program and Algorithm below :-

Reverse of a Number

Reverse of a Number Program to display reverse of a number Example  : Original Number : 423                  Reverse Number : 234 Program below :-

Factorial Number in JAVA

Program of Factorial Number Program to calculate factorial of a number. Factorial of a positive integer is the multiplication of  all positive integers greater than 0 and smaller than or equal to the number. Factorial of a number is denoted by (!) sign. Example : 5! = 5*4*3*2*1 = 120 Program below :-

Armstrong Number in JAVA

Armstrong Number Program to check a number is Armstrong or Not. A Number is said to be A rmstrong Number  if it is equal to the sum of cubes of its digits. Example : 0, 1, 153, 370, 371, 407 etc. Program below:-

Automorphic Number in JAVA

Automorphic Number Program to check a number is Automorphic or Not. A Number is said to be Automorphic if the last digit of its square is same as the Number. Example : Input: 25, Square= 625 Output : 25 is automorphic number. Program below:-