Trending ▼   ResFinder  

ICSE − Q & A

ICSE
Indian Certificate of Secondary Education (ICSE), New Delhi
+Fave Message

Ask a Question

Answer a Question!

ResFinder - Thousands of Practice Papers

How to change username on Respaper?
asked by Aquaman- King of the Seven Seas (shauns) 5 years ago
2
If anyone is having problems with arithmetic operations here

http://imgur.com/a/XqgAXAF

Rule is simple : 

Brackets should be solved first independent of it is multiplication or addition

Increament / decreament should be done very first , then all operations .
 
modulo / divide / multiply all lie on the same level , they have to solved from left to right . 

Addition and subtraction lie on a level below modulo / divide / multiply . If subtraction and addition both are given , solve left to right .
asked by Aditya Dungrani (chickezz5) 5 years ago
4

+ 1 more questions by chickezz5  

Any french guy know ' Stromae' . I forgot to ask it before
asked by Ansh Anand (teleansh) 5 years ago
3

+ 1 more questions by teleansh  

String programs apc ques for soln go to daddys code .com


1. Write a program to accept two different characters and display the sum and difference of their values.

Sample Input :
A
d
Sample Output :
The sum of ASCII values 165
The difference of ASCll value 35
2 Write a program to accept a character. If it is a letter, then display the case (i.e. lower or upper case), otherwise check whether it is a digit or a special character.

Sample Input: p
Sample output: p is a letter,
p is in lower case.
3. Write a program in Java to accept a word/a string and display the new string after removing all the vowels present in it.

Sample input COMPUTER APPLICATIONS
Sample output: CMPTR PPLCTONS
4. Write a program in Java to accept a word/a string. Count all the letters excluding the vowels present in the word/string and display the result.

Sample Input: Happy New Year
Sample Output : No. of letters excluding vowels 8
5. Write a program in Java to accept a name(Containing three words) and Display only the initials (i.e. first letter of each word.) 

Sample Input LAL KRISHNA ADVANI
Sample output LKA
6 Write a program in Java to accept a name containing three words and ​display the  surname first, followed by the first and middle names
Sample Input : MOHANDAS KARAMCHAND GANDHI  
​Sample Ouput : GANDHI MOHANDAS KARAMOHAND
7. Write a program in Java to accept a sentence and find the frequency of a given letter.

​Sample Input WE ARE LIVING IN COMPUTER WORLD
Enter a letter whose frequency is to be checked (Say: E)
Sample Output The frequency of 'E' is 3.
8. Write a program in Java to enter a string/sentence and display the longest word and the length of the longest word present in the String.

Sample Input : "TATA FOOTBALL ACADEMY WILL PLAY AGAINST MOHAN BAGAN"
Sample Output : The longest word FOOTTBALL : The length of the word : 8
9. Write a program in Java to accept String in upper case and find the frequency of each vowel present in the String.

Sample Input : "RAIN WATER HARVESTING ORGANISED BY JUSCO"
Sample Output :
Frequency of 'A' : 4
Frequency of 'E' : 3
Frequency of 'I' : 3
Frequency of 'O' : 2
Frequency of 'U' : 1
10. Write a program in Java to accept a String as :
"IF IT RAINS, YOU WILL NOT GO TO PLAY"
 Convert all letters of the words other than the first  letters to lower case so as to obtain the following output

Sample Output :
If It Rains, You Will Not Go To Play 
11. Write a program in Java to accept a word and display the ASCII of each character

Sample input :
BLUEJ

Sample output : 
ASCII of B : 66
ASCII of L : 75
ASCII of U : 84
ASCII of E : 69
ASCII of J : 73
12. Write a program in Java a String in upper case and replace all the vowels with Asterisk (*) present in the String.

Sample Input : "TATA STEEL IS IN JAMSHEDPUR"
Sample Output : "T*T* ST**L *S  *N J*MSH*DP*R"
13. Write a program to input a string. Print the new string after converting every alternate letter to uppercase and the next immediate letter to lowercase. The special characters remain the same..

Input : Delhi Public School
Output : DeLhl pUbLiC sChOoL
14. Write a program to accept a string. Modify the string by adding "hot' at the beginning of the word. If the string already contains hot, then the string remains unchanged.
Print the modified string and the message accordingly.

Sample Input: CAKE
Sample output: HOTCAKE

Sample Input: HOTLINE
Sample output: No change in the string
15. Write a program in Java to enter a string and frame a word by joining all the first characters of each word. Display the new word.

Sample Input : Vital Information Resource Under Seize
Sample output : VIRUS​
16. Write a program in Java to enter a string and display all the palindrome words present in the String.

Sample Input : MOM AND DAD ARE NOT AT HOME
Sample output :
MOM
DAD
17. Write a program to accept a string. Display the string in reverse order.

Sample Input :
Computer is Fun

Sample Output :
Fun is Computer
18. Write a program to input a string and print the character which occurs the maximum number of times within the String.

Sample Input : James Gosling developed Java
Sample output : The character with maximum number of times: e
19. Write a program to input a string and print the word containing the maximum number of vowels.

Sample Input : HAPPY NEW YEAR
Sample Output : The word with maximum number of vowels: YEAR
20. Consider the string as:
Blue bottle is in Blue bag lying on Blue carpet

Write a program to accept a sample string and replace the word Blue with Red, The new string is displayed as:
Red bottle is in Red bag lying on Red carpet
​21. A computer typist has the habit of deleting the middle name .'Kumar', while entering the names containing three words. Write a program to enter a name with three words and display the new name after deleting the middle name 'Kumar'.

​Sample Input : Ashish Kumar Nehra
Sample Output : Ashish Nehra
22 Write a program to accept a word and convert it into lower case, if it is in upper case. Display the new word by replacing only the vowels with the letter following it.

Sample Input : computer
Sample Output : cpmpvtfr
23. A string is said to be 'Unique' if none of the letters present in the string are repeated. Write a program to accept a string and check whether the string is Unique or not. The program displays a message accordingly.

Sample Input : COMPUTER
Sample Output : Unique String
24. Write a program to input a sentence in uppercase. Create a new sentence by replacing each vowel with the next (ie. A with E, U with A) and the other characters remain the same. Display the new sentence accordingly.

Sample Input : WE CELEBRATE 26 JANUARY AS REPUBLIC DAY
Sample Output : WI CILIBRETI 26 JENAERY ES RIPABLOC DEY
25. A "Happy Word' is defined as:
Take a word and calculate the word's value based on position of the letters in English alphabet. On the basis of word's value, find the sum of the squares of its digits. Repeat the process with the resultant number until the number equals 1 (one). If the number ends with 1 then it is called a 'Happy Word'. Write a program to input a word and check whether it a 'Happy Word' or not. The program displays a message accordingly.

Sample Input:
VAT
Place value of V=22, A=1, T=20
[Hint: A=1, B=2,..........Z=26]

Solution: 22120 = 2^2+2^2+1^2+2^2+0^2 = 13 = 1^2 + 3^2 = 10 = 1^2+0^2 = 1  
Sample Output : A Happy Word
26. A non-palindrome word can be made a palindrome word just by adding the reverse of the word to the original word. Write a program to accept a non-palindrome word and display the new word after making it a palindrome.

Sample Input :
ICSE
Sample Output :
The new word making it palindrome as:
 ICSEESCI
27. Write a program to input a string. Count and display the frequency of each letter in the order in which it is present in the String.

Sample Input : DADDY'S CODE
Sample Output : 
D : 3
A : 1 
Y : 1
S : 1
C : 1
O : 1 
D : 1 
​E : 1
28. Write a program to accept a string. Convert the string to upper case. Count and output the number of double letter sequences that exist in the string.

Sample Input : "SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE"
Sample output : 4
29. Special words are those words which start and end with the same letter.
Example: EXISTENCE, COMIC, WINDOW
Palindrome words are those words which read the same from left to right and vice
Example: MALYALAM, MADAM, LEVEL, ROTATOR, CIVIC
All palindromes are special words but all special words are not palindromes.
Write a program to accept a word. Print and display whether the word is a palindrome or only a special word.
30. Write a program to input a string. Convert the string to upper case. Count and print the words which have at least a pair of consecutive letters.

Sample Input : MODEM IS AN ELECTRONIC DEVICE
Sample Output :
MODEM
DEVICE
Number of words containing consecutive letters : 2
31. Write a program to accept a word (say,BLUEJ) and display the pattern:
(a)
BLUEJ
BLUE
BLU
BL 
​B
(b)
J
EE
UUU
LLLL
​BBBBB
(c)
BLUEJ
LUEJ
UEJ
EJ
​J
32. Write a program to display the pattern :
(a)
ABCDE
BCDE
CDE
DE 
​E
(b)
A
BC
DEF
GHIJ
​KLMNO
(c)
ABCDE
ABCDA
ABCAB
ABABC
AABCD
(d)
ABCDE
BCDE
CDE
DE
​E
(e)
EDCBA
EDCB
EDC
ED
​E
(f)
A
AB
ABC
ABCD
​ABCDE
33. Write a program to generate a triangle or an inverted triangle till n terms based upon the User's choice of the triangle to be displayed.
​Example 1 :
Input : Type 1 for a triangle and Type 2 for an inverted triangle
Enter Choice : 1
Enter No. of Lines : 5
Sample Output :
* * * * *
  * * * *
    * * *
      * *
        *
​Example 2 :
Input : Type 1 for a triangle and Type 2 for an inverted triangle
Enter Choice : 2
Enter No. of Lines : 5
Sample Output :
A B C D E
A B C D
A B C
A B
​A
34. Write a program to generate a triangle or an inverted triangle based upon User's Choice.
​Example 1 :
Input : Type 1 for a triangle and Type 2 for an inverted triangle
Enter Choice : 1
Enter a Word : BLUEJ
Sample Output :
* * * *B
* * * LL
* * UUU
* EEEE
JJJJJ

" * " are spaces.
​Example 2 :
Input : Type 1 for a triangle and Type 2 for an inverted triangle
Enter Choice : 2
Enter a Word : BLUEJ
Sample Output :
B L U E J
B L U E
B L U
B L
​B

35. Using the switch statement,  write a menu driven program for the following :
a. To Print the Floyd's Triangle :
1
2 3 
4 5 6
7 8 9 10
​11 12 13 14 15
b. To display the following pattern :
I
I C
I C S
​I C S E
For an incorrect option, an appropriate error message should be displayed.
 
Lol pretty useful
asked by Annhaliator (laxyone) 5 years ago
1

+ 2 more questions by laxyone  

Awful at computer both sections cuz our best teacher left the school mid term.
Any tips to score above 95 would be welcome.

Including tips on short questions. 
Yes I am aware of the types. I can do function, am good enough with looping but not perfect.
asked by Isha Choudhury (dessicatedcoconut) 5 years ago
3
Anyone can share circular prime program
asked by Ayush Agarwal (qwertyuiop12345678901234567890) 5 years ago
2
why is class an abstract data type?(precise explanation please) :)
asked by Arun Munagala (cyberking7) 5 years ago
3
0.1 - 0.064 = 0.936

Just give me the Fields medal for math already..

:"(
asked by ... (sam307) 5 years ago
6
How many of you are using guided computer applications ? Is APC better ?
asked by Not productions (pranav55) 5 years ago
8
number programs likely to come if they will come 

1. Write a Java program to check whether a given number is an ugly number. Go to the editor
In number system, ugly numbers are positive numbers whose only prime factors are 2, 3 or 5. First 10 ugly numbers are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12. By convention, 1 is included. 
Test Date:Input an integer number: 235 
Expected Output :
It is not an ugly number.

Click me to see the solution

2. Write a Java program to classify Abundant, deficient and perfect number (integers) between 1 to 10,000. Go to the editor
In number theory, an abundant number is a number for which the sum of its proper divisors is greater than the number itself.
Example :
The first few abundant numbers are:
12, 18, 20, 24, 30, 36, 40, 42, 48, 54, 56, 60, 66, 70, 72, 78, 80, 84, 88, 90, 96, 100, 102,…
The integer 12 is the first abundant number. Its proper divisors are 1, 2, 3, 4 and 6 for a total of 16.
Deficient number: In number theory, a deficient number is a number n for which the sum of divisors σ(n)<2n, or, equivalently, the sum of proper divisors (or aliquot sum) s(n)<n. The value 2n − σ(n) (or n − s(n)) is called the number's deficiency.
As an example, divisors of 21 are 1, 3 and 7, and their sum is 11. Because 11 is less than 21, the number 21 is deficient. Its deficiency is 2 × 21 − 32 = 10.
The first few deficient numbers are:
1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 21, 22, 23, 25, 26, 27, 29, 31, 32, 33, …….
Perfect number: In number system, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself.
Equivalently, a perfect number is a number that is half the sum of all of its positive divisors (including itself) i.e. σ1(n) = 2n.
The first perfect number is 6. Its proper divisors are 1, 2, and 3, and 1 + 2 + 3 = 6. Equivalently, the number 6 is equal to half the sum of all its positive divisors: ( 1 + 2 + 3 + 6 ) / 2 = 6. The next perfect number is 28 = 1 + 2 + 4 + 7 + 14. This is followed by the perfect numbers 496 and 8128.
Expected Output :
Number Counting [(integers) between 1 to 10,000]:
Deficient number: 7508
Perfect number: 4 
Abundant number: 2488

Click me to see the solution

3. Write a Java program to generate random integers in a specific range. Go to the editor
Click me to see the solution

4. Write a Java program to generate and show all Kaprekar numbers less than 1000. Go to the editor
Expected Output :

1       1         0 + 1                                  
9       81        8 + 1                                  
45      2025      20 + 25                                
55      3025      30 + 25                                
99      9801      98 + 01                                
297     88209     88 + 209                               
703     494209    494 + 209                              
999     998001    998 + 001                              
8 Kaprekar numbers.  
Click me to see the solution

5. Write a Java program to find the number of seed Lychrel number candidates and related numbers for n in the range 1..10000 inclusive. (With that iteration limit of 500). Go to the editor
A Lychrel number is a natural number that cannot form a palindrome through the iterative process of repeatedly reversing its digits and adding the resulting numbers. This process is sometimes called the 196-algorithm, after the most famous number associated with the process.
The first few Lychrel numbers are 196, 295, 394, 493, 592, 689, 691, 788, 790, 879, 887, ... .
Expected Output :
5 Lychrel seeds: [196, 879, 1997, 7059, 9999] 
244 Lychrel related 
5 Lychrel palindromes: [196, 879, 1997, 7059, 9999]

Click me to see the solution

6. Write a Java program to generate and show the first 15 narcissistic decimal numbers. Go to the editor
Expected Output :

0 1 2 3 4 5 6 7 8 9 153 370 371 407 1634
Click me to see the solution

7. Write a Java program to display first 10 lucus numbers. Go to the editor
The Lucas numbers or series are an integer sequence named after the mathematician François Édouard Anatole Lucas, who studied both that sequence and the closely related Fibonacci numbers. Lucas numbers and Fibonacci numbers form complementary instances of Lucas sequences.
The sequence of Lucas numbers is: 2, 1, 3, 4, 7, 11, 18, 29, ….
Expected Output :

   First ten Lucas a numbers:                                              
2                                                                       
1                                                                       
3                                                                       
4                                                                       
7                                                                       
11                                                                      
18                                                                      
29                                                                      
47                                                                      
76
Click me to see the solution

8.Write a Java program to print out the first 10 Catalan numbers by extracting them from Pascal's triangle. Go to the editor
In combinatorial mathematics, the Catalan numbers form a sequence of natural numbers that occur in various counting problems, often involving recursively-defined objects. They are named after the Belgian mathematician Eugène Charles Catalan.
The first Catalan numbers for n = 0, 1, 2, 3, … are 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, 129644790, 477638700, 1767263190, 6564120420, 24466267020, 91482563640, 343059613650, 1289904147324, 4861946401452,

List 10 Catalan numbers:-                                               
                                                                        
1                                                                       
2                                                                       
5                                                                       
14                                                                      
42                                                                      
132                                                                     
429                                                                     
1430                                                                    
4862                                                                    
16796  
Click me to see the solution

9. Write a Java program to find and print the first 10 happy numbers. Go to the editor
Happy number: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1, or it loops endlessly in a cycle which does not include 1.
Example: 19 is a happy number
12 + 92=82
82 + 22=68
62 + 82=100
12 + 02 + 02=1

Expected Output

First 10 Happy numbers:                                                 
1                                                                       
7                                                                       
10                                                                      
13                                                                      
19                                                                      
23                                                                      
28                                                                      
31   
Click me to see the solution

10. Write a Java program to check whether a given number is a happy number or unhappy number. Go to the editor
Happy number: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1, or it loops endlessly in a cycle which does not include 1.
An unhappy number is a number that is not happy.
The first few unhappy numbers are 2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 15, 16, 17, 18, 20.

Expected Output

Input a number: 5                                                       
Unhappy Number
Click me to see the solution

11. Write a Java program to check whether a given number is a Disarium number or unhappy number. Go to the editor
A Disarium number is a number defined by the following process :
Sum of its digits powered with their respective position is equal to the original number.
For example 175 is a Disarium number :
As 11+32+53 = 135
Some other DISARIUM are 89, 175, 518 etc.
A number will be called Disarium if the sum of its digits powered with their respective position is equal with the number itself. Sample Input: 135.
Expected Output

Input a number : 25                                                     
Not a Disarium Number.
Click me to see the solution

12. Write a Java program to check whether a number is a Harshad Number or not. Go to the editor
In recreational mathematics, a harshad number in a given number base, is an integer that is divisible by the sum of its digits when written in that base.
Example: Number 200 is a Harshad Number because the sum of digits 2 and 0 and 0 is 2(2+0+0) and 200 is divisible by 2. Number 171 is a Harshad Number because the sum of digits 1 and 7 and 1 is 9(1+7+1) and 171 is divisible by 9.
Expected Output

Input a number : 353  
                                                  
353 is not a Harshad Number.
Click me to see the solution

13. Write a Java program to check whether a number is a Pronic Number or Heteromecic Number or not. Go to the editor
A pronic number is a number which is the product of two consecutive integers, that is, a number of the form n(n + 1).
The first few pronic numbers are:
0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380, 420, 462 … etc.

Expected Output
Input a number : 110 
Pronic Number.

Click me to see the solution

14. Write a Java program check whether a number is an Automorphic number or not. Go to the editor
In mathematics, an automorphic number is a number whose square "ends" in the same digits as the number itself. For example, 52 = 25, 62 = 36, 762 = 5776, and 8906252 = 793212890625, so 5, 6, 76 and 890625 are all automorphic numbers.
Expected Output

Input a number : 76                                                   
Automorphic Number.
Click me to see the solution

15. Write a Java program to check whether a number is a Duck Number or not. Go to the editor
Note: 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 are not.
Expected Output

Input a number : 3210                                                   
Duck number
 
Click me to see the solution

16. Write a Java program to check two numbers are Amicable numbers or not. Go to the editor
Amicable numbers are two different numbers so related that the sum of the proper divisors of each is equal to the other number.
The first ten amicable pairs are: (220, 284), (1184, 1210), (2620, 2924), (5020, 5564), (6232, 6368), (10744, 10856), (12285, 14595), (17296, 18416), (63020, 76084), and (66928, 66992).
Expected Output

Input the first number: 220                                             
Input the second number: 284                                            
These numbers are amicable.
Click me to see the solution

17. Write a Java program to check if a given number is circular prime or not. Go to the editor
Circular Prime : A circular prime is a prime number with the property that the number generated at each intermediate step when cyclically permuting its (base 10) digits will be prime.
For example, 1193 is a circular prime, since 1931, 9311 and 3119 all are also prime. A circular prime with at least two digits can only consist of combinations of the digits 1, 3, 7 or 9, because having 0, 2, 4, 6 or 8 as the last digit makes the number divisible by 2, and having 0 or 5 as the last digit makes it divisible by 5.
Input Data:
Input a number: 35
Expected Output

It is not a Circular Prime number.

18. Write a Java program to check a number is a cube or not. Go to the editor
In arithmetic and algebra, the cube of a number n is its third power: the result of the number multiplied by itself twice:
n3 = n × n × n.
Input Data:
Input a number: 8 
Expected Output

Number is a cube

19. Write a Java program to check a number is a cyclic or not. Go to the editor
A cyclic number is an integer in which cyclic permutations of the digits are successive multiples of the number. The most widely known are 142857:
142857 × 1 = 142857
142857 × 2 = 285714
142857 × 3 = 428571
142857 × 4 = 571428
142857 × 5 = 714285
142857 × 6 = 857142
Input Data:
Input a number: 142857 
Expected Output

It is a cyclic number.


20. Write a Java program to display first 10 Fermat numbers. Go to the editor
In mathematics, a Fermat number is a positive integer of the form
Fermat Number
where n is a nonnegative integer.
The first few Fermat numbers are:
3, 5, 17, 257, 65537, 4294967297, 18446744073709551617, …
Expected Output

3.0                                                                     
5.0                                                                     
17.0                                                                    
257.0                                                                   
65537.0                                                                 
4.294967297E9                                                           
1.8446744073709552E19                                                   
3.4028236692093846E38                                                   
1.157920892373162E77                                                    
1.3407807929942597E154                                                  
Infinity   


21. Write java program to find any number between 1 and n that can be expressed as the sum of two cubes in two (or more) different ways.Here are some examples of Ramanujan numbers :
1729 = 1^3 + 12^3 = 9^3 + 10^3
* 10000
1729 = 1^3 + 12^3 = 9^3 + 10^3
4104 = 2^3 + 16^3 = 9^3 + 15^3
* 100000
1729 = 1^3 + 12^3 = 9^3 + 10^3
4104 = 2^3 + 16^3 = 9^3 + 15^3
13832 = 2^3 + 24^3 = 18^3 + 20^3
39312 = 2^3 + 34^3 = 15^3 + 33^3
46683 = 3^3 + 36^3 = 27^3 + 30^3
32832 = 4^3 + 32^3 = 18^3 + 30^3
40033 = 9^3 + 34^3 = 16^3 + 33^3
20683 = 10^3 + 27^3 = 19^3 + 24^3
65728 = 12^3 + 40^3 = 31^3 + 33^3
64232 = 17^3 + 39^3 = 26^3 + 36^3

Expected Output
1729 = 1^3 + 12^3 = 9^3 + 10^3                                          
4104 = 2^3 + 16^3 = 9^3 + 15^3                                          
13832 = 2^3 + 24^3 = 18^3 + 20^3                                        
39312 = 2^3 + 34^3 = 15^3 + 33^3                                        
46683 = 3^3 + 36^3 = 27^3 + 30^3                                        
32832 = 4^3 + 32^3 = 18^3 + 30^3                                        
40033 = 9^3 + 34^3 = 16^3 + 33^3                                        
20683 = 10^3 + 27^3 = 19^3 + 24^3                                       
65728 = 12^3 + 40^3 = 31^3 + 33^3                                       
64232 = 17^3 + 39^3 = 26^3 + 36^3


22. Write a program to check if a number is Mersenne number or not. Go to the editor
In mathematics, a Mersenne number is a prime number that can be written in the form Mn = 2n − 1 for some integer n.
The first four Mersenne primes are 3, 7, 31, and 127

Expected Output
Input a number: 127                                                     
127 is a Mersenne number.


23. Write a Java program to find all the narcissistic numbers between 1 and 1000. Go to the editor
In number theory, a narcissistic number is a number that is the sum of its own digits each raised to the power of the number of digits.
For example:
153 = 13 + 53 + 33

Expected Output
1                                                      
2                                                      
3                                                      
4                                                      
5                                                      
6                                                      
7                                                      
8                                                      
9                                                      
153                                                    
370                                                    
371                                                    
407


24. Write a Java program to check if a number is palindrome or not. Go to the editor
In number system a palindromic number is a number that is the same when written forwards or backwards, i.e., of the form .
The first few palindromic numbers are therefore are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, …

Expected Output
Input a number: 5                                                       
It is a Palindrome number. 


25. Write a Java program to print the first 15 numbers of the Pell series. Go to the editor
In mathematics, the Pell numbers are an infinite sequence of integers. The sequence of Pell numbers starts with 0 and 1, and then each Pell number is the sum of twice the previous Pell number and the Pell number before that.:
thus, 70 is the companion to 29, and 70 = 2 × 29 + 12 = 58 + 12.
The first few terms of the sequence are :
0, 1, 2, 5, 12, 29, 70, 169, 408, 985, 2378, 5741, 13860,…

Expected Output
First 20 Pell numbers:                                                  
1 2 5 12 29 70 169 408 985 2378 5741 13860 33461 80782 195025 470832 113
6689 2744210 6625109 15994428


26. Write a Program in Java to check whether a number is a Keith Number or not. Go to the editor
In recreational mathematics, a Keith number or repfigit number (short for repetitive Fibonacci-like digit) is a number in the following integer sequence:
14, 19, 28, 47, 61, 75, 197, 742, 1104, 1537, 2208, 2580, 3684, 4788, 7385, 7647, 7909, 31331, 34285, 34348, 55604, 62662, 86935, 93993, 120284, 129106, 147640, 156146, 174680, 183186, 298320, 355419, 694280, 925993,

Expected Output
Input a number: 75                                                         
Keith Number


27. Write a Java program to check if a given number is circular prime or not. Go to the editor
A circular prime is a prime number with the property that the number generated at each intermediate step when cyclically permuting its (base 10) digits will be prime. 
For example, 1193 is a circular prime,
since 1931, 9311 and 3119 all are also prime.
A circular prime with at least two digits can only consist of combinations of the digits 1, 3, 7 or 9, because having 0, 2, 4, 6 or 8 as the last digit makes the number divisible by 2, and having 0 or 5 as the last digit makes it divisible by 5

Expected Output
Input a number: 1193                                                    
Output:                                                                 
        1193                                                            
        1931                                                            
        9311                                                            
        3119                                                            
                                                                        
        1193 is a circular_num Prime number.

28. Write a Java program to create the first twenty Hamming numbers. Go to the editor
In computer science, regular numbers are often called Hamming numbers, Hamming Numbers are numbers whose only prime factors are 2, 3 and 5.
The first few hamming numbers are :
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32

Expected Output
First Twenty Hamming numbers: 1 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27
 30 32 3
asked by Shreyansh (shreyansh06) 5 years ago
5

<< Prev

    Page 344    

Next Page >>

ICSE chat

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us