Posts

Showing posts from 2019

Armstrong Numbers upto 'n' numbers in JAVA

Armstrong Number in JAVA Armstrong Number : A number is said to be Armstrong Number, If it is a equal to the sum of its own digits each raised to the power of the number of digits. Example: Input                    : 153 No. of Digits        : 3 Sum of digits      : 1 3 + 5 3 + 3 3 = 1 + 125 + 27 = 153 Output                 : It is an Armstrong Number Input                   : 15 No. of Digits       : 2 Sum of digits     : 1 2 + 5 2 = 1 + 25 = 26 Output                : It is not an Armstrong Number Input                   : 1634 No. of Digits      : 4 Sum of digits    : 1 4 + 6 4 + 3 4 + 4 4 = 1 + 1296 + 81 + 256 = 1634 Output               : It is an Armstrong Number

ISC Paper 2019 Matrix Program

Image
ISC Computer Science Practical Paper - 2019 Question 2 Solved Write a program to declare a single dimensional array a[] and a square matrix b[][] of size N , where N>2 and N<10 . Allow the user to input positive integers into the single dimensional array . Example :- Input    : N = 3                 Enter elements of single dimensional array : 3  1  7 Output  : Sorted Array : 1  3  7                  Filled Matrix                      1  3  7                      1  3  1                      1  1  3 For more examples see the question paper image below :-

Calculate Date Program in JAVA

Image
Date Program This program is asked in ISC Computer Science Practical Paper 2019 Q.1 - Design a Program to accept a day number (between 1 and 366), year (in 4 digit) from the user to generate and display the corresponding date. Also, accept ' N ' (1 <= N <= 100) from the user to compute and display the future date corresponding to ' N ' days after the generated date. Display an error message if the value of the day number, year, and N are not within the limit or not according to the condition specified. Example :-  Input :      Day Number  : 255                  N Days          : 42                  Year               : 2018 Output :    Date is        : 12 TH September 2018                  N Date is    : 24 TH October 2018

Unique Number in JAVA

Image
Unique Number Unique Number : A number is said to be a Unique number if it is a positive integer (without leading zeros) with no duplicate digits. For example : 7 , 135 , 214 are all unique numbers whereas 33 , 3121, 300 are not. Input     : 142 Output  : It is a Unique Number Input     :0125 Output  : It is not a Unique Number Input     : 131 Output  : It is not a Unique Number

Sunny Number in JAVA

Image
Sunny Number Sunny Number : A number 'n' is said to be a Sunny Number if the square root of 'n+1' number is an integer. Example : 8 is a Special number since '8+1' i.e. 9 has a square root 3 which is an integer. Input     : 8 Output  : It is a Sunny Number Input     :12 Output  : It is not a Sunny Number Input     : 24 Output  : It is a Sunny Number

Special Number in JAVA

Image
Special Number Special Number : A number is said to be Special Number if the sum of factorial of its digits is equal to the number itself.  Example : 145 is a Special Number. Sum of factorial of digits : 1! + 4!+ 5! = 1 + 24 + 120 = 145  Input     : 145 Output  : It is a Special Number Input     : 220 Output  : It is not a Special Number

Duck Number in JAVA

Image
Duck Number Duck Number : A Duck number is a number which has zeroes present in it, but there should be no zero present in the beginning of the number.  For example : 3210, 7056, 8430709 are all duck numbers, whereas 08237, 04309, 2357,1253 etc are not. Input     : 50401 Output  : It is a Duck Number Input     : 04208 Output  : It is not a Duck Number Input     : 4231 Output  : It is not a Duck Number

Buzz Number in JAVA

Image
Buzz Number Buzz Number - A number is said to be Buzz Number if it ends with 7 or is divisible by 7 . Example : Input    : 307                  Output  : It is a Buzz Number                  Input    : 63                  Output  : It is a Buzz Number                  Input    : 52                  Output  : It is not a Buzz Number Algorithm and Program given below :-

GoldBach Number in JAVA

Goldbach Number in JAVA A Goldbach number is a positive even integer that can be expressed as the sum of two odd prime numbers. All even integers greater than 4 are Goldbach numbers.  The expression of a given even number as a sum of two primes is called a Goldbach partition of that number. Examples of Goldbach Numbers are :- 6 = 3 + 3   8 = 3 + 5   10 = 3 + 7 = 5 + 5   12 = 7 + 5

Number Name in JAVA

Image
Number Name in JAVA Write a Program to input a number and Display it in Words Note : Entered number should be between 0 and 99  Example : Input    : 79                  Output  : Seventy Nine                                     Input    : 85                  Output  : Eighty Five Algorithm and Program given below :-

ROT13 Program Easy Method

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 Input : Mind   Output : Zvaq Algorithm and Program given below :-