- Prime number : print n prime numbers
- Print second frequently occurring number in given series Example : Input: 1 1 2 3 1 2 4 Output: 2
- Given an array of characters print the characters that have n number of occurrences. If a character appears consecutively it is counted as 1 occurrence Eg: a b a a b c c d e d Here a has only 2 occurrences
- Find the maximum of three numbers
- Print the total number of odd and even digits in the given number.
Input : 1234567
Output : ODD 4 EVEN 3
INPUT : Size of Array : 8
Enter the elements : 2 5 1 6 2 6 7 10 OUTPUT : 7
INPUT : Size of Array : 4
Enter the elements : 4 1 2 2
OUTPUT : 2
INPUT : Size of Array : 1
Enter the elements : 1
OUTPUT : No second maximum
INPUT :
Enter Row Size : 4
Enter column size : 3
Enter the matrix :
1 0 1
1 1 0
1 1 1
1 0 1
OUTPUT :
Unique Matrix :
1 0 1
1 1 0
1 1 1
INPUT : Enter the array size : 8
Enter the elements : 1,3,5,2,1,8,6,9
Enter the window size : 3
OUTPUT : 5 5 5 8 8 9
- Write a program to determine whether a given number can be expressed as sum of two prime numbers or not. For example 34 can be expressed as sum of two prime numbers but 23 cannot be. -Take a 2 or 3 digit input number, reverse it and add it to the original number until the obtained number is a palindrome or 5 iterations are completed.
Input : n = 32
Output : 55
23 + 32 = 55 which is a palindrome.
Input : 39
Output : 363 which is a palindrome
Input:
Number of digits:12
9 2 8 1 3 5 6 7 3 1 1 6
Number of digits:9
7 8 4 6 2 1 9 9 7
Output :
9 2 8 9 2 0 2 9 5 1 1 3
Input
Array = {1 3 4 8 10} N = 7
output
true
t d
h r
i
h r
t d
Example:
Input: {2, 3, 2, 6, 1, 6, 2}
Output:
1 : 1
2 : 3
3 : 1
6 : 2
- Given an array, find the minimum of all the greater numbers for each element in the array. Sample: Array : {2, 3, 7, 1, 8, 5, 11} Output: {2>3, 3>5, 7>8, 1>2, 8>11, 5>7, 11>}
- Given a string, we have to reverse the string without changing the position of punctuations and spaces.
I/P: house no : 123@ cbe
Output: ebc32 1o : nes@ uoh
Input Output
1 A
26 Z
27 AA
- You're given a number n. If write all the numbers from 1 to n in a paper, we have to find the number of characters written on the paper.For example if n=13, the output should be 17 if n = 101, the output should be 195 -Given two numbers a and b both < 200 we have to find the square numbers which lie between a and b(inclusive)
eg) i/p a = 20;b = 100;
o/p : 25,36,49,64,81,100
Array1: [1, 2, 3, 6, 9]
Array2: [2, 4, 5, 10]
Merged Array: [1, 2, 3, 4, 5, 6, 9, 10]
-To find the odd numbers in between the range.
Input:
2
15
Output:
3,5,7,9,11,13
- To find the factors of the numbers given in an array and to sort the numbers in descending order according to the factors present in it. Input: Given array : 8, 2, 3, 12, 16 Output: 12, 16, 8, 2, 3
- Write a program to give the following output for the given input Eg 1: Input: a1b10 Output: abbbbbbbbbb Eg: 2: Input: b3c6d15 Output: bbbccccccddddddddddddddd The number varies from 1 to 99
- Reverse only the characters:
I/P:ZOHO123
O/P:OHOZ123
I/P:zohomail
O/P:zihamool
- Given a set of numbers, and a digit in each iteration, if the digit exists in any of the numbers, remove its occurrences and ask for the next digit till the list becomes empty.
- Write a Code to implement
I/P: N=15
O/P: 1,-2,-3,4,5,6,-7,-8,-9,-10,11,12,13,14,15.]
Input : [ 2 2 3 4 5 12 2 3 3 3 12 ]
Output : 3 3 3 3 2 2 2 12 12 4 5