1. Write a program to accept a number and display the highest digit in the number.
Eg: If the number input is 23156, the highest digit in the number is 6.
2. Write a program to display all 3 digit prime numbers.
3. Write a program to generate first 20 Fibonacci series.
0,1,1,2,3,5,8,13…….20 terms.
The first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the previous two.
4. Write a program to input a number and check whether it is a Pronic number or not.
Pronic number is the number which is the product of two consecutive integers.
Example: 12 is a pronic number as 12 = 3 * 4
20 = 4 * 5
42 = 6 * 7
5. Write a program to display all the numbers between 100 and 200 which don’t contain zeroes at any position.
Eg: 111,112,113…….199
Answers
Answered by
1
Answer:
Given a range L to R, the task is to find the highest occurring digit in prime numbers lie between L and R (both inclusive). If multiple digits have same highest frequency print the largest of them. If no prime number occurs between L and R, output -1.
Examples:
Input : L = 1 and R = 20.
Output : 1
Prime number between 1 and 20 are 2, 3, 5, 7, 11, 13, 17, 19.
1 occur maximum i.e 5 times among 0 to 9.
Similar questions